Sha256: c7904f5fb4c6a08e53d2c5990c20730f394807e04f457de196524ed238eb0350

Contents?: true

Size: 967 Bytes

Versions: 23

Compression:

Stored size: 967 Bytes

Contents

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

module RR
  module Expectations
    describe TimesCalledExpectation do
      context "when using an AtLeastMatcher" do
        it_should_behave_like "RR::Expectations::TimesCalledExpectation"

        before do
          mock(subject).foobar.at_least(3)
        end

        describe "#verify!" do
          it "passes when times called > times" do
            4.times {subject.foobar}
            RR.verify
          end

          it "passes when times called == times" do
            3.times {subject.foobar}
            RR.verify
          end

          it "raises error when times called < times" do
            subject.foobar
            lambda do
              RR.verify
            end.should raise_error(
            RR::Errors::TimesCalledError,
            "foobar()\nCalled 1 time.\nExpected at least 3 times."
            )
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 19 versions & 5 rubygems

Version Path
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_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/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
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/expectations/times_called_expectation/times_called_expectation_at_least_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/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
bitclust-core-0.5.2 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/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
bitclust-core-0.5.1 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
mcmire-rr-1.0.5.rc1 spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
rr-1.0.4 spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
rr-1.0.3 spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rr-1.0.2/spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb
rr-1.0.2 spec/rr/expectations/times_called_expectation/times_called_expectation_at_least_spec.rb