Sha256: c853c8750ce48cc7e9ee068b8699f1e37ee81949fc3ea81f0bfb7766aad7ec74

Contents?: true

Size: 967 Bytes

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
rspec-0.6.0 test/spec/api/helper/should_satisfy_test.rb
rspec-0.6.1 test/spec/api/helper/should_satisfy_test.rb
rspec-0.6.2 test/spec/api/helper/should_satisfy_test.rb
rspec-0.6.3 test/spec/api/helper/should_satisfy_test.rb