changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
3module Spec
4 module Mocks
5
6 describe "AnyNumberOfTimes" do
7 before(:each) do
8 @mock = Mock.new("test mock")
9 end
10
11 it "should pass if any number of times method is called many times" do
12 @mock.should_receive(:random_call).any_number_of_times
13 (1..10).each do
14 @mock.random_call
15 end
16 end
17
18 it "should pass if any number of times method is called once" do
19 @mock.should_receive(:random_call).any_number_of_times
20 @mock.random_call
21 end
22
23 it "should pass if any number of times method is not called" do
24 @mock.should_receive(:random_call).any_number_of_times
25 end
26 end
27
28 end
29end