Sha256: 00a9da7e0cd6a530b84cc5bc04b6834a70229f890645287e27da3d1f7e16440a

Contents?: true

Size: 903 Bytes

Versions: 113

Compression:

Stored size: 903 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

describe "should satisfy { block }" do
  it "should pass if block returns true" do
    true.should satisfy { |val| val }
    true.should satisfy do |val|
      val
    end
  end

  it "should fail if block returns false" do
    lambda {
      false.should satisfy { |val| val }
    }.should fail_with("expected false to satisfy block")
    lambda do
      false.should satisfy do |val|
        val
      end
    end.should fail_with("expected false to satisfy block")
  end
end

describe "should_not satisfy { block }" do
  it "should pass if block returns false" do
    false.should_not satisfy { |val| val }
    false.should_not satisfy do |val|
      val
    end
  end

  it "should fail if block returns true" do
    lambda {
      true.should_not satisfy { |val| val }
    }.should fail_with("expected true not to satisfy block")
  end
end

Version data entries

113 entries across 113 versions & 15 rubygems

Version Path
rspec-0.9.1 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.5 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.4 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.3 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.2 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.1 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.0 spec/spec/matchers/satisfy_spec.rb
rspec-0.9.4 spec/spec/matchers/satisfy_spec.rb
rspec-0.9.3 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.6 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.10 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.1 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.0 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.8 spec/spec/matchers/satisfy_spec.rb
rspec-1.0.7 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.12 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.2 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.11 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.3 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.7 spec/spec/matchers/satisfy_spec.rb