Sha256: 55cc02c3b7d9d30e97baac72aaa8152640aff242bddca66b0f7193576dbc9a98

Contents?: true

Size: 1004 Bytes

Versions: 49

Compression:

Stored size: 1004 Bytes

Contents

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

describe Micronaut::Matchers do

  describe "equal" do
    
    it "should match when actual.equal?(expected)" do
      equal(1).matches?(1).should be_true
    end
    
    it "should not match when !actual.equal?(expected)" do
      equal("1").matches?("1").should be_false
    end
    
    it "should describe itself" do
      matcher = equal(1)
      matcher.matches?(1)
      matcher.description.should == "equal 1"
    end
    
    it "should provide message, expected and actual on #failure_message" do
      matcher = equal("1")
      matcher.matches?(1)
      matcher.failure_message.should == ["expected \"1\", got 1 (using .equal?)", "1", 1]
    end
    
    it "should provide message, expected and actual on #negative_failure_message" do
      matcher = equal(1)
      matcher.matches?(1)
      matcher.negative_failure_message.should == ["expected 1 not to equal 1 (using .equal?)", 1, 1]
    end
    
  end

end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
spicycode-micronaut-0.1.7.2 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.7.3 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.7.4 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.7 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.8.0 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.8.1 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.8.2 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.8.3 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.8.5 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.1.9.0 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.0.0 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.1.0 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.1.1 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.1.2 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.1.3 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.1.4 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.1.5 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.1.6 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.10 examples/lib/micronaut/matchers/equal_example.rb
spicycode-micronaut-0.2.2 examples/lib/micronaut/matchers/equal_example.rb