Sha256: ba52421d0a997e36c4f4ddb6be4fc4208119c2dad88a05ad81ffa19268e0c1e7

Contents?: true

Size: 751 Bytes

Versions: 45

Compression:

Stored size: 751 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

module Spec
  module Mocks
    
    describe "AnyNumberOfTimes" do
      before(:each) do
        @mock = Mock.new("test mock")
      end

      it "should pass if any number of times method is called many times" do
        @mock.should_receive(:random_call).any_number_of_times
        (1..10).each do
          @mock.random_call
        end
      end

      it "should pass if any number of times method is called once" do
        @mock.should_receive(:random_call).any_number_of_times
        @mock.random_call
      end
      
      it "should pass if any number of times method is not called" do
        @mock.should_receive(:random_call).any_number_of_times
      end
    end

  end
end

Version data entries

45 entries across 45 versions & 8 rubygems

Version Path
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
deckshuffler-0.0.2 vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
radiant-0.6.5 vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
radiant-0.6.7 vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
radiant-0.6.6 vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb
radiant-0.6.9 vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb