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-1.1.6 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.5 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.4 spec/spec/matchers/satisfy_spec.rb
rspec-1.2.0 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.8 spec/spec/matchers/satisfy_spec.rb
rspec-1.1.9 spec/spec/matchers/satisfy_spec.rb
rspec-1.2.1 spec/spec/matchers/satisfy_spec.rb
rspec-1.2.2 spec/spec/matchers/satisfy_spec.rb
rspec-1.2.4 spec/spec/matchers/satisfy_spec.rb
rspec-1.2.3 spec/spec/matchers/satisfy_spec.rb
rspec-1.2.6 spec/spec/matchers/satisfy_spec.rb
rspec-1.2.5 spec/spec/matchers/satisfy_spec.rb
spree-0.2.0 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
spree-0.4.0 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
spree-0.4.1 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
spree-0.5.0 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
spree-0.6.0 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
spree-0.5.1 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
spree-0.7.0 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
spree-0.7.1 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb