Sha256: a2b0bf25428cabc07df339887a6e7bcd1d4d1ec5dde29489f584bac62668f51e

Contents?: true

Size: 1.16 KB

Versions: 45

Compression:

Stored size: 1.16 KB

Contents

require File.dirname(__FILE__) + '/test_unit_spec_helper'

describe "Test::Unit::TestCase" do
  include TestUnitSpecHelper
  
  before(:each) do
    @dir = File.dirname(__FILE__) + "/resources"
  end
  
  describe "with passing test case" do
    it "should output 0 failures" do
      output = ruby("#{@dir}/test_case_that_passes.rb")
      output.should include("1 example, 0 failures")
    end

    it "should return an exit code of 0" do
      ruby("#{@dir}/test_case_that_passes.rb")
      $?.should == 0
    end
  end

  describe "with failing test case" do
    it "should output 1 failure" do
      output = ruby("#{@dir}/test_case_that_fails.rb")
      output.should include("1 example, 1 failure")
    end

    it "should return an exit code of 256" do
      ruby("#{@dir}/test_case_that_fails.rb")
      $?.should == 256
    end
  end

  describe "with test case that raises an error" do
    it "should output 1 failure" do
      output = ruby("#{@dir}/test_case_with_errors.rb")
      output.should include("1 example, 1 failure")
    end

    it "should return an exit code of 256" do
      ruby("#{@dir}/test_case_with_errors.rb")
      $?.should == 256
    end
  end
end

Version data entries

45 entries across 45 versions & 8 rubygems

Version Path
dchelimsky-rspec-1.1.99.13 spec/spec/interop/test/unit/testcase_spec.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
rspec-1.2.7 spec/spec/interop/test/unit/testcase_spec.rb
rspec-1.2.8 spec/spec/interop/test/unit/testcase_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
pictrails-0.5.0 vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
radiant-0.6.5 vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
radiant-0.6.6 vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
radiant-0.6.7 vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb
radiant-0.6.8 vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb