Sha256: 9b17a4b7247eef26c948226c60bec9a6dd70109e372c07c56e0c78c83503f1c6

Contents?: true

Size: 1.13 KB

Versions: 292

Compression:

Stored size: 1.13 KB

Contents

# Upgrade to rspec-expectations-2.0

## What's new

### New `eq` matcher.

`RSpec::Matchers` now offers you two approaches to differentiating between
object identity. You can use the rspec-1 approach:

    actual.should == expected     # object equality
    actual.should equal(expected) # object identity

... or, if you prefer:

    actual.should eq(expected) # object equality
    actual.should be(expected) # object identity

## What's been removed

### simple_matcher

Use RSpec::Matchers.define instead. For example, if you had:

    def eat_cheese
      simple_matcher("eat cheese") do |actual|
        actual.eat?(:cheese)
      end
    end

Change it to:

    RSpec::Matchers.define :eat_cheese do
      match do |actual|
        actual.eat?(:cheese)
      end
    end

### wrap_expectation

Use RSpec::Matchers.define instead.

    RSpec::Matchers.define :eat_cheese do
      match do |actual|
        actual.should eat?(:cheese)
      end
    end

    RSpec::Matchers.define :eat_cheese do
      include MyCheesyAssertions
      match_unless_raises Test::Unit::AssertionFailedError do |actual|
        assert_eats_chesse actual
      end
    end

Version data entries

292 entries across 191 versions & 29 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/Upgrade.md
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.1/features/Upgrade.md
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.10.0/features/Upgrade.md
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.0/features/Upgrade.md
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.0/features/Upgrade.md
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.10.0/features/Upgrade.md
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.1/features/Upgrade.md
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.0/features/Upgrade.md
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.10.0/features/Upgrade.md
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.1/features/Upgrade.md
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-expectations-2.14.5/features/Upgrade.md
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-expectations-2.13.0/features/Upgrade.md
rspec-expectations-2.99.2 features/Upgrade.md