Sha256: 51ba89fcf3d1d9738a361c41e890cc6929f7b66cadcee2763bb7aaf7927aa933

Contents?: true

Size: 1.2 KB

Versions: 21

Compression:

Stored size: 1.2 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
          expect(matcher).to be_possible_match(0)
          expect(matcher).to be_possible_match(99999)
        end
      end

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

      describe AnyTimesMatcher, "#attempt?" do
        it "always returns true" do
          expect(matcher).to be_attempt(0)
          expect(matcher).to 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
          expect(matcher.error_message(2)).to eq \
            "Called 2 times.\nExpected any number of times."
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rr-3.1.1 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.1.0 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.9 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.8 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.7 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.6 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.5 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.4 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.3 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.2 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.1 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-3.0.0 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.2.1 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.2.0 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.1.2 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.1.2.rc1 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.1.1.rc1 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.1.0 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.1.0.rc3 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb
rr-1.1.0.rc2 spec/suites/rspec_2/unit/times_called_matchers/any_times_matcher_spec.rb