PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/jruby-1.1.6RC1/lib/ruby/gems/1.8/gems/rspec-1.1.11/spec/spec/interop/test/unit/testcase_spec.rb

https://bitbucket.org/nicksieger/advent-jruby
Ruby | 49 lines | 40 code | 9 blank | 0 comment | 3 complexity | 46b83b66accda6de3c797a0debe704cc MD5 | raw file
Possible License(s): CPL-1.0, AGPL-1.0, LGPL-2.1, JSON
  1. require File.dirname(__FILE__) + '/test_unit_spec_helper'
  2. describe "Test::Unit::TestCase" do
  3. include TestUnitSpecHelper
  4. before(:each) do
  5. @dir = File.dirname(__FILE__) + "/resources"
  6. end
  7. describe "with passing test case" do
  8. it "should output 0 failures" do
  9. output = ruby("#{@dir}/test_case_that_passes.rb")
  10. output.should include("1 example, 0 failures")
  11. end
  12. it "should return an exit code of 0" do
  13. ruby("#{@dir}/test_case_that_passes.rb")
  14. $?.should == 0
  15. end
  16. end
  17. describe "with failing test case" do
  18. it "should output 1 failure" do
  19. output = ruby("#{@dir}/test_case_that_fails.rb")
  20. output.should include("1 example, 1 failure")
  21. end
  22. it "should return an exit code of 256" do
  23. ruby("#{@dir}/test_case_that_fails.rb")
  24. $?.should == 256
  25. end
  26. end
  27. describe "with test case that raises an error" do
  28. it "should output 1 failure" do
  29. output = ruby("#{@dir}/test_case_with_errors.rb")
  30. output.should include("1 example, 1 failure")
  31. end
  32. it "should return an exit code of 256" do
  33. ruby("#{@dir}/test_case_with_errors.rb")
  34. $?.should == 256
  35. end
  36. end
  37. describe "not yet implemented examples:" do
  38. it "this example should be reported as pending (not an error)"
  39. end
  40. end