Class: Cerberus::Builder::RSpec
- Defined in:
- lib/cerberus/builder/rspec.rb
Instance Attribute Summary
Attributes inherited from RubyBase
Instance Method Summary collapse
- #brokeness ⇒ Object
-
#initialize(config) ⇒ RSpec
constructor
A new instance of RSpec.
- #run ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
#initialize(config) ⇒ RSpec
Returns a new instance of RSpec.
4 5 6 |
# File 'lib/cerberus/builder/rspec.rb', line 4 def initialize(config) super(config, "rspec", "spec") end |
Instance Method Details
#brokeness ⇒ Object
17 18 19 20 21 |
# File 'lib/cerberus/builder/rspec.rb', line 17 def brokeness if @output =~ /\d+ examples, (\d+) failures?/ $1.to_i end end |
#run ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/cerberus/builder/rspec.rb', line 8 def run @output = if @config[:builder, @name.to_sym, :task] `#{@config[:bin_path]}rake #{@config[:builder, @name.to_sym, :task]} 2>&1` else `#{@config[:bin_path]}rake #{choose_exec()} 2>&1` end successful? end |
#successful? ⇒ Boolean
23 24 25 |
# File 'lib/cerberus/builder/rspec.rb', line 23 def successful? $?.exitstatus == 0 and not @output.include?("#{@cmd} aborted!") and @output.include?("0 failures") end |