Sha256: 0b21eb6d32f5e3f16383c16de1a239cc6df0dd60be62575ceb9deaaf8e80f29a

Contents?: true

Size: 924 Bytes

Versions: 54

Compression:

Stored size: 924 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../../../example_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

54 entries across 54 versions & 3 rubygems

Version Path
rsanheim-micronaut-0.1.3.2 examples/lib/micronaut/matchers/satisfy_example.rb
rsanheim-micronaut-0.1.4.1 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.0.3 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.0.4 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.0.5 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.0.6 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.0.7 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.0.9 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.0 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.1 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.2 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.3 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.4.1 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.4.2 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.4.3 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.4.4 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.4 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.5.2 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.5 examples/lib/micronaut/matchers/satisfy_example.rb
spicycode-micronaut-0.1.6.1 examples/lib/micronaut/matchers/satisfy_example.rb