Sha256: 319dcb14b26c2e804a6fe323ce25d709d6fb123aeab49f61aefc0c506ca4f3f0

Contents?: true

Size: 1.45 KB

Versions: 15

Compression:

Stored size: 1.45 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

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

    it "returns false" do
      @expectation.should_not be_terminal
    end
  end
end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rr-0.1.14 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.1.15 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.2.4 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.0 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.3 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.2.3 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.2.5 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.2 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.2.1 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.2.2 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.4 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.1 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.6 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.5 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb
rr-0.3.7 examples/rr/expectations/times_called_expectation/times_called_expectation_any_times_example.rb