Sha256: e78498a37f0cdad942fb269238aebe2dc7b85e4d2607158c583f806fcf4edd5f

Contents?: true

Size: 1.14 KB

Versions: 11

Compression:

Stored size: 1.14 KB

Contents

require "spec/spec_helper"

module RR
  module TimesCalledMatchers
    describe AnyTimesMatcher do
      attr_reader :matcher
      before do
        @matcher = AnyTimesMatcher.new
      end

      describe AnyTimesMatcher, "#possible_match?" do
        it "always returns true" do
          matcher.should be_possible_match(0)
          matcher.should be_possible_match(99999)
        end
      end

      describe AnyTimesMatcher, "#matches?" do
        it "always returns true" do
          matcher.should be_matches(0)
          matcher.should be_matches(99999)
        end
      end

      describe AnyTimesMatcher, "#attempt?" do
        it "always returns true" do
          matcher.should be_attempt(0)
          matcher.should be_attempt(99999)
        end
      end

      describe AnyTimesMatcher, "#terminal?" do
        it "returns false" do
          matcher.should_not be_terminal
        end
      end

      describe AnyTimesMatcher, "#error_message" do
        it "has an error message" do
          matcher.error_message(2).should == (
          "Called 2 times.\nExpected any number of times."
          )
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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