Sha256: 2d8f29b4a34ae617b98ab02208d0348a1b9e3e9d3be6c51121c992c2bc32282c

Contents?: true

Size: 1.34 KB

Versions: 24

Compression:

Stored size: 1.34 KB

Contents

require "examples/example_helper"

module RR
module Expectations
  describe ArgumentEqualityExpectation, "#exact_match? with numeric argument" do
    before do
      @expectation = ArgumentEqualityExpectation.new(numeric)
    end
    
    it "returns true when passed in an IsA module" do
      @expectation.should be_exact_match(WildcardMatchers::Numeric.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 ArgumentEqualityExpectation, "#wildcard_match? with Numeric argument" do
    before do
      @expectation = ArgumentEqualityExpectation.new(numeric)
    end

    it "returns true when passed a Numeric" do
      @expectation.should be_wildcard_match(99)
    end

    it "returns false when not passed a Numeric" do
      @expectation.should_not be_wildcard_match(:not_a_numeric)
    end

    it "returns true when an exact match" do
      @expectation.should be_wildcard_match(numeric)
    end

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rr-0.1.15 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.1.13 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.1.12 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.1.11 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.1.14 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.1.10 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.2.5 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.1 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.2.4 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.11 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.10 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.2.3 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.3 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.2 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.0 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.2.1 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.2.2 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.4 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.1.9 examples/rr/expectations/numeric_argument_equality_expectation_example.rb
rr-0.3.8 examples/rr/expectations/numeric_argument_equality_expectation_example.rb