Skip to content

Commit

Permalink
add failing tests for exitstatus issue
Browse files Browse the repository at this point in the history
  • Loading branch information
comboy committed Apr 11, 2012
1 parent 46ee9c3 commit df4c3c0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/fixtures/example_spec2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Foo
def bar
"baz"
end
end

describe Foo do
it "should baz" do
Foo.new.bar.should == "baz"
end

it "should not fail" do
1.should == 1
end
end
24 changes: 24 additions & 0 deletions spec/models/moci/test_runner/spec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@
@tsr.test_unit_runs.find{|t| t.test_unit.name == "should fail sometimes"}.run_time.should > 0.2
end

it "should save proper exitstatus" do
@tsr.exitstatus.should == false
end
end

context "with another example spec" do
before :all do
@ts = Factory.create :test_suite, :suite_type => 'Spec', :suite_options => {'specs' => 'spec/foo_spec.rb'}
@tsr = Factory.create :test_suite_run
spec_dir = File.join(@tsr.project_instance.working_directory, 'spec')
FileUtils.mkdir_p(File.join(@tsr.project_instance.working_directory, 'spec'))
FileUtils.cp(File.join(Rails.root,'spec','fixtures','example_spec2.txt'), File.join(spec_dir,'foo_spec.rb'))
@spec = Moci::TestRunner::Spec.new @tsr
@spec.run
@tsr.reload
end

it "should find 2 tests" do
@tsr.tests_count.should == 2
end

it "should save proper exit status" do
@tsr.exitstatus.should == true
end
end

end

0 comments on commit df4c3c0

Please sign in to comment.