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
dchelimsky-rspec-1.1.10 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11.1 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.1 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.13 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.2 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.3 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.4 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.5 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.6 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.7 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.8 spec/spec/matchers/satisfy_spec.rb
dchelimsky-rspec-1.1.99.9 spec/spec/matchers/satisfy_spec.rb