rspec-mocks 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,12 +1,13 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ %w[rspec-core rspec-expectations rspec-mocks].each do |lib|
4
+ gem lib, :path => File.expand_path("../../#{lib}", __FILE__)
5
+ end
6
+
3
7
  gem "rake"
4
- gem "cucumber"
5
- gem "aruba", ">= 0.2.0"
8
+ gem "cucumber", "0.8.5"
9
+ gem "aruba", "0.2.2"
6
10
  gem "autotest"
7
- gem "rspec-mocks", :path => "."
8
- gem "rspec-core", :path => "../rspec-core"
9
- gem "rspec-expectations", :path => "../rspec-expectations"
10
11
  gem "relish"
11
12
 
12
13
  case RUBY_VERSION.to_s
@@ -1,11 +1,11 @@
1
1
  ## rspec-mocks release history (incomplete)
2
2
 
3
- ### 2.0.1 / 2010-10-18
3
+ ### 2.1.0 / 2010-11-07
4
4
 
5
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.0...v2.0.1)
5
+ [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.0.1...v2.1.0)
6
6
 
7
- * Enhancements
8
- * Make dependencies on other rspec gems consistent across gems
7
+ * Bug fixes
8
+ * Fix serialization of stubbed object (Josep M Bach)
9
9
 
10
10
  ### 2.0.0 / 2010-10-10
11
11
 
@@ -3,11 +3,15 @@
3
3
  rspec-mocks provides a test-double framework for rspec including support
4
4
  for method stubs, fakes, and message expectations.
5
5
 
6
- ## Install
6
+ ## Documentation
7
+
8
+ * [Cucumber features](http://relishapp.com/rspec/rspec-mocks/v/2-0)
9
+ * [RDoc](http://rubydoc.info/gems/rspec-mocks/2.0.1/frames)
7
10
 
8
- gem install rspec --prerelease
11
+ ## Install
9
12
 
10
- This will install rspec, rspec-core, rspec-expectations and rspec-mocks.
13
+ gem install rspec # for rspec-core, rspec-expectations, rspec-mocks
14
+ gem install rspec-mocks # for rspec-mocks only
11
15
 
12
16
  ## Method Stubs
13
17
 
@@ -5,7 +5,7 @@ module RSpec
5
5
 
6
6
  def initialize(*args, &block)
7
7
  @args = args
8
- @matchers_block = block if args.empty?
8
+ @matchers_block = args.empty? ? block : nil
9
9
  @match_any_args = false
10
10
  @matchers = nil
11
11
 
@@ -0,0 +1,25 @@
1
+ module Marshal
2
+
3
+ class << self
4
+
5
+ def dump_with_mocks(*args)
6
+ object = args.shift
7
+ return dump_without_mocks(*args.unshift(object)) unless object.instance_variable_defined?(:@mock_proxy)
8
+
9
+ mp = object.instance_variable_get(:@mock_proxy)
10
+ object.send(:remove_instance_variable, :@mock_proxy)
11
+
12
+ begin
13
+ dump_without_mocks(*args.unshift(object.dup))
14
+ ensure
15
+ object.instance_variable_set(:@mock_proxy,mp)
16
+ end
17
+ end
18
+
19
+ alias_method :dump_without_mocks, :dump
20
+ undef_method :dump
21
+ alias_method :dump, :dump_with_mocks
22
+
23
+ end
24
+
25
+ end
@@ -1,3 +1,5 @@
1
+ require 'rspec/mocks/extensions/marshal'
2
+
1
3
  module RSpec
2
4
  module Mocks
3
5
  module Serialization
@@ -1,7 +1,7 @@
1
1
  module RSpec # :nodoc:
2
2
  module Mocks # :nodoc:
3
3
  module Version # :nodoc:
4
- STRING = '2.0.1'
4
+ STRING = '2.1.0'
5
5
  end
6
6
  end
7
7
  end
@@ -21,8 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.extra_rdoc_files = [ "README.markdown" ]
22
22
  s.rdoc_options = ["--charset=UTF-8"]
23
23
  s.require_path = "lib"
24
-
25
- s.add_dependency "rspec-core", "~> 2.0.1"
26
- s.add_dependency "rspec-expectations", "~> 2.0.1"
27
24
  end
28
25
 
@@ -60,9 +60,7 @@ module RSpec
60
60
  end
61
61
 
62
62
  it 'marshals the same with and without stubbing' do
63
- pending("not sure how to fix this yet") do
64
- expect { set_stub }.to_not change { Marshal.dump(subject) }
65
- end
63
+ expect { set_stub }.to_not change { Marshal.dump(subject) }
66
64
  end
67
65
  end
68
66
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-mocks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
4
  prerelease: false
6
5
  segments:
7
6
  - 2
8
- - 0
9
7
  - 1
10
- version: 2.0.1
8
+ - 0
9
+ version: 2.1.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - David Chelimsky
@@ -16,41 +15,10 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-10-18 00:00:00 -05:00
18
+ date: 2010-11-07 01:00:00 -05:00
20
19
  default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 13
29
- segments:
30
- - 2
31
- - 0
32
- - 1
33
- version: 2.0.1
34
- requirement: *id001
35
- type: :runtime
36
- name: rspec-core
37
- prerelease: false
38
- - !ruby/object:Gem::Dependency
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 13
45
- segments:
46
- - 2
47
- - 0
48
- - 1
49
- version: 2.0.1
50
- requirement: *id002
51
- type: :runtime
52
- name: rspec-expectations
53
- prerelease: false
20
+ dependencies: []
21
+
54
22
  description: RSpec's 'test double' framework, with support for stubbing and mocking
55
23
  email: dchelimsky@gmail.com;chad.humphries@gmail.com
56
24
  executables: []
@@ -85,6 +53,7 @@ files:
85
53
  - lib/rspec/mocks/error_generator.rb
86
54
  - lib/rspec/mocks/errors.rb
87
55
  - lib/rspec/mocks/extensions/instance_exec.rb
56
+ - lib/rspec/mocks/extensions/marshal.rb
88
57
  - lib/rspec/mocks/extensions/object.rb
89
58
  - lib/rspec/mocks/framework.rb
90
59
  - lib/rspec/mocks/message_expectation.rb
@@ -157,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
126
  requirements:
158
127
  - - ">="
159
128
  - !ruby/object:Gem::Version
160
- hash: 3
129
+ hash: -1767543596298256707
161
130
  segments:
162
131
  - 0
163
132
  version: "0"
@@ -166,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
135
  requirements:
167
136
  - - ">="
168
137
  - !ruby/object:Gem::Version
169
- hash: 3
138
+ hash: -1767543596298256707
170
139
  segments:
171
140
  - 0
172
141
  version: "0"
@@ -176,7 +145,7 @@ rubyforge_project: rspec
176
145
  rubygems_version: 1.3.7
177
146
  signing_key:
178
147
  specification_version: 3
179
- summary: rspec-mocks-2.0.1
148
+ summary: rspec-mocks-2.1.0
180
149
  test_files:
181
150
  - features/README.markdown
182
151
  - features/message_expectations/block_local_expectations.feature.pending