Sha256: f2a5c529fc9b30b326d9bcd27e79b6489bb278df3633a6f7f027d0d8d81be54b

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

require "spec/spec_helper"

module RR
  module Expectations
    describe TimesCalledExpectation, ' with AnyTimesMatcher' do
      it_should_behave_like "RR::Expectations::TimesCalledExpectation"
      attr_reader :at_least

      before do
        @at_least = TimesCalledMatchers::AnyTimesMatcher.new
        @expectation = TimesCalledExpectation.new(scenario, at_least)
      end
      
      describe "#verify!" do
        it "always passes" do
          expectation.verify!
          10.times {expectation.attempt!}
          expectation.verify!
        end
      end

      describe "#attempt?" do
        it "always returns true" do
          expectation.should be_attempt
          10.times {expectation.attempt!}
          expectation.should be_attempt
        end
      end

      describe "#attempt!" do
        it "always passes" do
          10.times {expectation.attempt!}
        end
      end

      describe "#terminal?" do
        it "returns false" do
          expectation.should_not be_terminal
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rr-0.4.0 spec/rr/expectations/times_called_expectation/times_called_expectation_any_times_spec.rb
rr-0.4.1 spec/rr/expectations/times_called_expectation/times_called_expectation_any_times_spec.rb
rr-0.4.2 spec/rr/expectations/times_called_expectation/times_called_expectation_any_times_spec.rb