Sha256: b1ada18bf47f3c22e04669cef237af8bf5ff45aa015c43a32d1f6cf482256e3d

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

require "examples/example_helper"

module RR
module Expectations
  describe TimesCalledExpectation, ' with AnyTimesMatcher', :shared => true do
    it_should_behave_like "RR::Expectations::TimesCalledExpectation"
    
    before do
      @at_least = TimesCalledMatchers::AnyTimesMatcher.new
      @expectation = TimesCalledExpectation.new(@at_least)
    end
  end

  describe TimesCalledExpectation, "#verify! with AnyTimesMatcher" do
    it_should_behave_like "RR::Expectations::TimesCalledExpectation with AnyTimesMatcher"

    it "always passes" do
      @expectation.verify!
      10.times {@expectation.attempt!}
      @expectation.verify!
    end
  end

  describe TimesCalledExpectation, "#attempt? with AnyTimesMatcher" do
    it_should_behave_like "RR::Expectations::TimesCalledExpectation with AnyTimesMatcher"

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

  describe TimesCalledExpectation, "#attempt! with AnyTimesMatcher" do
    it_should_behave_like "RR::Expectations::TimesCalledExpectation with AnyTimesMatcher"
    
    it "always passes" do
      10.times {@expectation.attempt!}
    end
  end
end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rr-0.1.11 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.1.10 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.1.12 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.1.13 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.1.9 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb