Sha256: 2eaf6e1f3184d5e2a680395561791269d318fb589a29aab3e33bbab3283f499c

Contents?: true

Size: 1.13 KB

Versions: 16

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

16 entries across 16 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.beta.8 Upgrade.markdown
rspec-expectations-2.0.0.beta.7 Upgrade.markdown
rspec-expectations-2.0.0.beta.6 Upgrade.markdown
rspec-expectations-2.0.0.beta.5 Upgrade.markdown
rspec-expectations-2.0.0.beta.4 Upgrade.markdown
rspec-expectations-2.0.0.beta.3 Upgrade.markdown
rspec-expectations-2.0.0.beta.2 Upgrade.markdown
rspec-expectations-2.0.0.beta.1 Upgrade.markdown
rspec-expectations-2.0.0.a10 Upgrade.markdown
rspec-expectations-2.0.0.a9 Upgrade.markdown
rspec-expectations-2.0.0.a8 Upgrade.markdown
rspec-expectations-2.0.0.a7 Upgrade.markdown
rspec-expectations-2.0.0.a6 Upgrade.markdown
rspec-expectations-2.0.0.a5 Upgrade.markdown
rspec-expectations-2.0.0.a4 Upgrade.markdown
rspec-expectations-2.0.0.a3 Upgrade.markdown