Sha256: 5ec1b44f52287d90a37faca396f20a023ece551a2768285f23f2237fd8000be8

Contents?: true

Size: 1.18 KB

Versions: 56

Compression:

Stored size: 1.18 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../../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

56 entries across 52 versions & 9 rubygems

Version Path
adva-0.3.2 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.3.1 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.3.0 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.2.4 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.2.3 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.2.2 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.2.1 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.2.0 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.1.4 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.1.3 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.1.2 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.1.1 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.1.0 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
adva-0.0.1 test/rr/spec/rr/times_called_matchers/any_times_matcher_spec.rb
jferris-rr-0.7.1.0.1239654108 spec/rr/times_called_matchers/any_times_matcher_spec.rb
redinger-redinger-rr-0.10.3 spec/rr/times_called_matchers/any_times_matcher_spec.rb
redinger-rr-0.10.4 spec/rr/times_called_matchers/any_times_matcher_spec.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/spec/rr/times_called_matchers/any_times_matcher_spec.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/spec/rr/times_called_matchers/any_times_matcher_spec.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/spec/rr/times_called_matchers/any_times_matcher_spec.rb