Sha256: 0c4c0ec89df459151c4f7e2aab2388fe6ee5f86606a22d3b9cd45d3186471858

Contents?: true

Size: 955 Bytes

Versions: 49

Compression:

Stored size: 955 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../../../example_helper")

describe Micronaut::Matchers do

  describe "eql" do

    it "should match when actual.eql?(expected)" do
      eql(1).matches?(1).should be_true
    end

    it "should not match when !actual.eql?(expected)" do
      eql(1).matches?(2).should be_false
    end

    it "should describe itself" do
      matcher = eql(1)
      matcher.matches?(1)
      matcher.description.should == "eql 1"
    end

    it "should provide message, expected and actual on #failure_message" do
      matcher = eql("1")
      matcher.matches?(1)
      matcher.failure_message.should == ["expected \"1\", got 1 (using .eql?)", "1", 1]
    end

    it "should provide message, expected and actual on #negative_failure_message" do
      matcher = eql(1)
      matcher.matches?(1)
      matcher.negative_failure_message.should == ["expected 1 not to equal 1 (using .eql?)", 1, 1]
    end

  end

end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
rsanheim-micronaut-0.1.3.2 examples/lib/micronaut/matchers/eql_example.rb
rsanheim-micronaut-0.1.4.1 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.0.9 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.0 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.1 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.2 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.3 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.4.1 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.4.2 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.4.3 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.4.4 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.4 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.5.2 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.5 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.6.1 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.6.8 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.6.9.1 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.6.9 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.6 examples/lib/micronaut/matchers/eql_example.rb
spicycode-micronaut-0.1.7.1 examples/lib/micronaut/matchers/eql_example.rb