Sha256: 5a7f3c53085a625823ce94e74c6d045a491efc26fb35fbf3f93a03d8192eeabb

Contents?: true

Size: 1.21 KB

Versions: 11

Compression:

Stored size: 1.21 KB

Contents

require "spec/spec_helper"

module RR
  module Expectations
    describe ArgumentEqualityExpectation, "matching anything" do
      attr_reader :expectation
      before do
        @expectation = ArgumentEqualityExpectation.new(anything)
      end

      describe "#exact_match? with anything argument" do
        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 "#wildcard_match? with is_a String argument" do
        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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rr-0.4.6 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.8 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.0 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.2 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.3 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.7 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.5 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.10 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.1 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.9 spec/rr/expectations/anything_argument_equality_expectation_spec.rb
rr-0.4.4 spec/rr/expectations/anything_argument_equality_expectation_spec.rb