Sha256: f24667eebb68e15d78faac15020118f45e353ccebbc037121e174c0505cc14f5

Contents?: true

Size: 967 Bytes

Versions: 15

Compression:

Stored size: 967 Bytes

Contents

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



module Spec
  module Api
    module Helper
      class ShouldSatisfyTest < Test::Unit::TestCase

        def test_should_raise_exception_when_block_yields_false
          assert_raise(ExpectationNotMetError) do
            5.should.satisfy {|target| false }
          end
        end
  
        def test_should_not_raise_exception_when_block_yields_true
          assert_nothing_raised do
            5.should.satisfy {|target| true }
          end
        end

        # should.not.satisfy
  
        def test_should_raise_exception_when_block_yields_false_again
          assert_raise(ExpectationNotMetError) do
            5.should.not.satisfy {|target| true }
          end
        end
  
        def test_should_not_raise_exception_when_block_yields_true_again
          assert_nothing_raised do
            5.should.not.satisfy {|target| false }
          end
        end

      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rspec-0.5.12 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.10 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.11 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.15 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.16 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.2 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.3 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.4 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.5 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.6 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.7 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.9 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.8 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.13 test/spec/api/helper/should_satisfy_test.rb
rspec-0.5.14 test/spec/api/helper/should_satisfy_test.rb