rspec-mocks 2.5.0 → 2.6.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/Gemfile +13 -12
- data/Guardfile +3 -3
- data/README.md +2 -0
- data/features/.nav +4 -0
- data/features/Changelog.md +12 -0
- data/features/README.markdown +44 -4
- data/features/message_expectations/any_instance.feature +19 -0
- data/features/message_expectations/block_local_expectations.feature.pending +2 -2
- data/features/message_expectations/expect_message.feature +3 -3
- data/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +3 -3
- data/features/method_stubs/README.md +32 -24
- data/features/method_stubs/any_instance.feature +23 -0
- data/features/method_stubs/as_null_object.feature +36 -0
- data/features/method_stubs/simple_return_value.feature +2 -2
- data/features/method_stubs/stub_chain.feature +13 -6
- data/features/method_stubs/stub_implementation.feature +1 -1
- data/features/method_stubs/to_ary.feature +45 -0
- data/features/outside_rspec/configuration.feature +3 -3
- data/features/outside_rspec/standalone.feature +2 -2
- data/features/step_definitions/additional_cli_steps.rb +4 -0
- data/features/support/env.rb +5 -1
- data/lib/rspec/mocks.rb +2 -1
- data/lib/rspec/mocks/any_instance.rb +246 -0
- data/lib/rspec/mocks/extensions/psych.rb +23 -0
- data/lib/rspec/mocks/framework.rb +1 -0
- data/lib/rspec/mocks/message_expectation.rb +7 -4
- data/lib/rspec/mocks/methods.rb +1 -1
- data/lib/rspec/mocks/mock.rb +2 -2
- data/lib/rspec/mocks/serialization.rb +5 -3
- data/lib/rspec/mocks/space.rb +1 -1
- data/lib/rspec/mocks/version.rb +1 -1
- data/spec/rspec/mocks/and_yield_spec.rb +3 -3
- data/spec/rspec/mocks/any_instance_spec.rb +578 -0
- data/spec/rspec/mocks/any_number_of_times_spec.rb +22 -28
- data/spec/rspec/mocks/at_least_spec.rb +6 -0
- data/spec/rspec/mocks/at_most_spec.rb +6 -0
- data/spec/rspec/mocks/bug_report_10263_spec.rb +12 -14
- data/spec/rspec/mocks/bug_report_7611_spec.rb +2 -4
- data/spec/rspec/mocks/failing_argument_matchers_spec.rb +45 -46
- data/spec/rspec/mocks/nil_expectation_warning_spec.rb +1 -2
- data/spec/rspec/mocks/passing_argument_matchers_spec.rb +119 -122
- data/spec/rspec/mocks/precise_counts_spec.rb +6 -0
- data/spec/rspec/mocks/serialization_spec.rb +21 -3
- data/spec/rspec/mocks/stub_chain_spec.rb +72 -37
- data/spec/rspec/mocks/stub_spec.rb +64 -61
- data/spec/rspec/mocks/to_ary_spec.rb +31 -0
- metadata +32 -15
- data/spec/rspec/mocks/bug_report_7805_spec.rb +0 -22
- data/spec/rspec/mocks/bug_report_8302_spec.rb +0 -26
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Bug7805
|
4
|
-
#This is really a duplicate of 8302
|
5
|
-
|
6
|
-
describe "Stubs should correctly restore module methods" do
|
7
|
-
it "1 - stub the open method" do
|
8
|
-
File.stub(:open).and_return("something")
|
9
|
-
File.open.should == "something"
|
10
|
-
end
|
11
|
-
it "2 - use File.open to create example.txt" do
|
12
|
-
filename = "#{File.dirname(__FILE__)}/example-#{Time.new.to_i}.txt"
|
13
|
-
File.exist?(filename).should be_false
|
14
|
-
file = File.open(filename,'w')
|
15
|
-
file.close
|
16
|
-
File.exist?(filename).should be_true
|
17
|
-
File.delete(filename)
|
18
|
-
File.exist?(filename).should be_false
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Bug8302
|
4
|
-
describe "Bug report 8302:" do
|
5
|
-
class Foo
|
6
|
-
def Foo.class_method(arg)
|
7
|
-
end
|
8
|
-
|
9
|
-
def instance_bar(arg)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
it "class method is not restored correctly when proxied" do
|
14
|
-
Foo.should_not_receive(:class_method).with(Array.new)
|
15
|
-
Foo.rspec_verify
|
16
|
-
Foo.class_method(Array.new)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "instance method is not restored correctly when proxied" do
|
20
|
-
foo = Foo.new
|
21
|
-
foo.should_not_receive(:instance_bar).with(Array.new)
|
22
|
-
foo.rspec_verify
|
23
|
-
foo.instance_bar(Array.new)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|