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
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.6 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.7 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
picolena-0.1.8 rails_plugins/rspec/spec/spec/matchers/satisfy_spec.rb
pictrails-0.5.0 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
radiant-0.6.5 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
radiant-0.6.6 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
radiant-0.6.7 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
radiant-0.6.8 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
radiant-0.6.9 vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb
rspec-0.0.10 spec/spec/matchers/satisfy_spec.rb
rspec-0.9.2 spec/spec/matchers/satisfy_spec.rb
rspec-0.9.0 spec/spec/matchers/satisfy_spec.rb