rspec-mocks 3.5.0.beta4 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +7 -2
- data/lib/rspec/mocks/error_generator.rb +27 -25
- data/lib/rspec/mocks/message_expectation.rb +8 -0
- data/lib/rspec/mocks/version.rb +1 -1
- metadata +10 -10
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 369230b27c82d856c459fbae0bb3edbf679860ec
|
4
|
+
data.tar.gz: 1503479a7c3fb2ecbd49440a6adcb5694de0b9c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d48bea5a6043e2558b42478f71dd029b26ebafdc788de72547024f78cfdca5aabdd704a54b1c1de18b6992e61f2ab16c812bdd860e42c0295608ac51be7c9eb
|
7
|
+
data.tar.gz: 8e4ce2f66bc481a487d601e38674f5d02b8c7ed61e31608e2b3c49c5112a09c39d64b9fa71a7263908e2360d5e9bcb56c040fad6837786ff179efee17a124901
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
-
### 3.5
|
2
|
-
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta4...
|
1
|
+
### 3.5.0 / 2016-07-01
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta4...v3.5.0)
|
3
|
+
|
4
|
+
Enhancements:
|
5
|
+
|
6
|
+
* Provides a nice string representation of
|
7
|
+
`RSpec::Mocks::MessageExpectation` (Myron Marston, #1095)
|
3
8
|
|
4
9
|
### 3.5.0.beta4 / 2016-06-05
|
5
10
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.5.0.beta3...v3.5.0.beta4)
|
@@ -218,6 +218,33 @@ module RSpec
|
|
218
218
|
"To disallow expectations on `nil`, set `config.allow_message_expectations_on_nil` to `false`"
|
219
219
|
end
|
220
220
|
|
221
|
+
# @private
|
222
|
+
def intro(unwrapped=false)
|
223
|
+
case @target
|
224
|
+
when TestDouble then TestDoubleFormatter.format(@target, unwrapped)
|
225
|
+
when Class then
|
226
|
+
formatted = "#{@target.inspect} (class)"
|
227
|
+
return formatted if unwrapped
|
228
|
+
"#<#{formatted}>"
|
229
|
+
when NilClass then "nil"
|
230
|
+
else @target.inspect
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
# @private
|
235
|
+
def method_call_args_description(args, generic_prefix=" with arguments: ", matcher_prefix=" with ")
|
236
|
+
case args.first
|
237
|
+
when ArgumentMatchers::AnyArgsMatcher then "#{matcher_prefix}any arguments"
|
238
|
+
when ArgumentMatchers::NoArgsMatcher then "#{matcher_prefix}no arguments"
|
239
|
+
else
|
240
|
+
if yield
|
241
|
+
"#{generic_prefix}#{format_args(args)}"
|
242
|
+
else
|
243
|
+
""
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
221
248
|
private
|
222
249
|
|
223
250
|
def received_part_of_expectation_error(actual_received_count, args)
|
@@ -234,19 +261,6 @@ module RSpec
|
|
234
261
|
end
|
235
262
|
end
|
236
263
|
|
237
|
-
def method_call_args_description(args)
|
238
|
-
case args.first
|
239
|
-
when ArgumentMatchers::AnyArgsMatcher then " with any arguments"
|
240
|
-
when ArgumentMatchers::NoArgsMatcher then " with no arguments"
|
241
|
-
else
|
242
|
-
if yield
|
243
|
-
" with arguments: #{format_args(args)}"
|
244
|
-
else
|
245
|
-
""
|
246
|
-
end
|
247
|
-
end
|
248
|
-
end
|
249
|
-
|
250
264
|
def unexpected_arguments_message(expected_args_string, actual_args_string)
|
251
265
|
"with unexpected arguments\n expected: #{expected_args_string}\n got: #{actual_args_string}"
|
252
266
|
end
|
@@ -290,18 +304,6 @@ module RSpec
|
|
290
304
|
RSpec::Support::Differ.new(:color => RSpec::Mocks.configuration.color?)
|
291
305
|
end
|
292
306
|
|
293
|
-
def intro(unwrapped=false)
|
294
|
-
case @target
|
295
|
-
when TestDouble then TestDoubleFormatter.format(@target, unwrapped)
|
296
|
-
when Class then
|
297
|
-
formatted = "#{@target.inspect} (class)"
|
298
|
-
return formatted if unwrapped
|
299
|
-
"#<#{formatted}>"
|
300
|
-
when NilClass then "nil"
|
301
|
-
else @target
|
302
|
-
end
|
303
|
-
end
|
304
|
-
|
305
307
|
def __raise(message, backtrace_line=nil, source_id=nil)
|
306
308
|
message = opts[:message] unless opts[:message].nil?
|
307
309
|
exception = RSpec::Mocks::MockExpectationError.new(message)
|
@@ -343,6 +343,14 @@ module RSpec
|
|
343
343
|
self
|
344
344
|
end
|
345
345
|
|
346
|
+
# @return [String] a nice representation of the message expectation
|
347
|
+
def to_s
|
348
|
+
args_description = error_generator.method_call_args_description(@argument_list_matcher.expected_args, "", "") { true }
|
349
|
+
args_description = "(#{args_description})" unless args_description.start_with?("(")
|
350
|
+
"#<#{self.class} #{error_generator.intro}.#{message}#{args_description}>"
|
351
|
+
end
|
352
|
+
alias inspect to_s
|
353
|
+
|
346
354
|
# @private
|
347
355
|
# Contains the parts of `MessageExpectation` that aren't part of
|
348
356
|
# rspec-mocks' public API. The class is very big and could really use
|
data/lib/rspec/mocks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.0
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -45,22 +45,22 @@ cert_chain:
|
|
45
45
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
46
46
|
F3MdtaDehhjC
|
47
47
|
-----END CERTIFICATE-----
|
48
|
-
date: 2016-
|
48
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 3.5.0
|
56
|
+
version: 3.5.0
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 3.5.0
|
63
|
+
version: 3.5.0
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: diff-lcs
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,14 +205,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
205
205
|
version: 1.8.7
|
206
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
|
-
- - "
|
208
|
+
- - ">="
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version:
|
210
|
+
version: '0'
|
211
211
|
requirements: []
|
212
212
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.
|
213
|
+
rubygems_version: 2.5.1
|
214
214
|
signing_key:
|
215
215
|
specification_version: 4
|
216
|
-
summary: rspec-mocks-3.5.0
|
216
|
+
summary: rspec-mocks-3.5.0
|
217
217
|
test_files: []
|
218
218
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|