Sha256: 45911b0f419df2f06774d8b21ace3dc72c32126ffd460fd235c7f3a643828f66

Contents?: true

Size: 868 Bytes

Versions: 59

Compression:

Stored size: 868 Bytes

Contents

require 'spec_helper'

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

59 entries across 59 versions & 12 rubygems

Version Path
rspec-instructure-1.3.3 spec/spec/matchers/satisfy_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/spec/spec/matchers/satisfy_spec.rb
rspec-1.3.2 spec/spec/matchers/satisfy_spec.rb
rspec-1.3.1 spec/spec/matchers/satisfy_spec.rb
rspec-1.3.1.rc spec/spec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.19 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.18 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.17 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.16 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.15 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.14 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.13 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.12 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.11 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.10 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.9 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.8 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.7 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.6 spec/rspec/matchers/satisfy_spec.rb
rspec-expectations-2.0.0.beta.5 spec/rspec/matchers/satisfy_spec.rb