Sha256: bf279bb224cb42d488d496a35abf888640bd7770a0058d2292e624d0924d0734

Contents?: true

Size: 1.5 KB

Versions: 12

Compression:

Stored size: 1.5 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")

module RR
  module Expectations
    describe AnyArgumentExpectation do
      attr_reader :expectation

      before do
        @expectation = AnyArgumentExpectation.new
      end

      describe "#expected_arguments" do
        it "returns an empty array" do
          expect(expectation.expected_arguments).to eq []
        end
      end

      describe "==" do
        it "returns true when comparing with another AnyArgumentExpectation" do
          expect(expectation).to eq AnyArgumentExpectation.new
        end

        it "returns false when comparing with ArgumentEqualityExpectation" do
          expect(expectation).to_not eq ArgumentEqualityExpectation.new([1], {})
        end
      end

      describe "#exact_match?" do
        it "returns false" do
          expectation.should_not be_exact_match([1, 2, 3], {})
          expectation.should_not be_exact_match([1, 2], {})
          expectation.should_not be_exact_match([1], {})
          expectation.should_not be_exact_match([], {})
          expectation.should_not be_exact_match(["does not match"], {})
        end
      end

      describe "#wildcard_match?" do
        it "returns true" do
          expectation = AnyArgumentExpectation.new
          expect(expectation).to be_wildcard_match([1, 2, 3], {})
          expect(expectation).to be_wildcard_match(["whatever"], {})
          expect(expectation).to be_wildcard_match(["whatever", "else"], {})
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rr-3.1.1 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.1.0 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.9 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.8 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.7 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.6 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.5 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.4 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.3 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.2 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.1 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb
rr-3.0.0 spec/suites/rspec_2/unit/expectations/any_argument_expectation_spec.rb