Sha256: 00352f0e80b79712d04f920f0236ed6d00e79f80fc8514464535e05b683e5f7a

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

dir = File.dirname(__FILE__)
require "#{dir}/../../example_helper"

module RR
module Expectations
  describe ArgumentEqualityError, "#exact_match? with anything argument" do
    before do
      @expectation = ArgumentEqualityError.new(anything)
    end
    
    it "returns true when passed in an Anything module" do
      @expectation.should be_exact_match(WildcardMatchers::Anything.new)
    end

    it "returns false otherwise" do
      @expectation.should_not be_exact_match("hello")
      @expectation.should_not be_exact_match(:hello)
      @expectation.should_not be_exact_match(1)
      @expectation.should_not be_exact_match(nil)
      @expectation.should_not be_exact_match()
    end
  end

  describe ArgumentEqualityError, "#wildcard_match? with is_a String argument" do
    before do
      @expectation = ArgumentEqualityError.new(anything)
    end

    it "returns true when passed correct number of arguments" do
      @expectation.should be_wildcard_match(Object.new)
    end

    it "returns false when not passed correct number of arguments" do
      @expectation.should_not be_wildcard_match()
      @expectation.should_not be_wildcard_match(Object.new, Object.new)
    end
  end
end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rr-0.1.1 examples/rr/expectations/anything_argument_equality_expectation_example.rb
rr-0.1.6 examples/rr/expectations/anything_argument_equality_expectation_example.rb
rr-0.1.5 examples/rr/expectations/anything_argument_equality_expectation_example.rb
rr-0.1.4 examples/rr/expectations/anything_argument_equality_expectation_example.rb
rr-0.1.2 examples/rr/expectations/anything_argument_equality_expectation_example.rb
rr-0.1.3 examples/rr/expectations/anything_argument_equality_expectation_example.rb