rspec-sleeping_king_studios 1.0.0.rc.2 → 1.0.0.rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -6
- data/lib/rspec/sleeping_king_studios/matchers/built_in/respond_to.rb +24 -9
- data/lib/rspec/sleeping_king_studios/matchers/core/have_property.rb +1 -1
- data/lib/rspec/sleeping_king_studios/matchers/core/have_reader.rb +1 -1
- data/lib/rspec/sleeping_king_studios/matchers/core/have_writer.rb +1 -1
- data/lib/rspec/sleeping_king_studios/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c08fc787018b6d170c2377aa29f486a15140ec51
|
4
|
+
data.tar.gz: 0990079313ec742c6055508f030b7c4222020827
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bff008c1242e47d4b1c4f9ddff5b2a0edfdec88e9f22c1fffacf30413244b6a1aafb290b2559b37bc8c15a8f34e4313baa83057e61103ca7af2cf8d0496cafe2
|
7
|
+
data.tar.gz: 5824eb7b9afb0c5d7fa3ee1435d48fb307e51f77101006545c1f3c0d7bee4b282368eb672beefc90b34d1c967feef503d48864601298892aedd980f1faa1863c
|
data/README.md
CHANGED
@@ -124,15 +124,10 @@ Has additional functionality to support Ruby 2.0 keyword arguments.
|
|
124
124
|
|
125
125
|
**Chaining:**
|
126
126
|
|
127
|
-
* **with:** Expects one Integer
|
127
|
+
* **with:** Expects at most one Integer or Range argument, and zero or more
|
128
128
|
Symbol arguments corresponding to optional keywords. Verifies that the method
|
129
129
|
accepts that keyword, or has a variadic keyword of the form \*\*params.
|
130
130
|
|
131
|
-
_Important note:_ If you do not wish to validate the number of arguments,
|
132
|
-
make sure to use nil as the first argument to #with; otherwise, the matcher
|
133
|
-
will interpret your first keyword as the number of arguments to expect. And
|
134
|
-
then explode.
|
135
|
-
|
136
131
|
### Core
|
137
132
|
|
138
133
|
require 'rspec/sleeping_king_studios/matchers/core'
|
@@ -19,17 +19,32 @@ module RSpec::SleepingKingStudios::Matchers::BuiltIn
|
|
19
19
|
super
|
20
20
|
end # method matches?
|
21
21
|
|
22
|
-
#
|
23
|
-
#
|
22
|
+
# @overload with count
|
23
|
+
# Adds a parameter count expectation.
|
24
24
|
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
# @param [Array<String, Symbol>] keywords list of keyword arguments
|
28
|
-
# accepted by the method
|
25
|
+
# @param [Integer, Range, nil] count (optional) The number of expected
|
26
|
+
# parameters.
|
29
27
|
#
|
30
|
-
#
|
31
|
-
|
32
|
-
|
28
|
+
# @return [RespondToMatcher] self
|
29
|
+
# @overload with *keywords
|
30
|
+
# Adds one or more keyword expectations (Ruby 2.0 only).
|
31
|
+
#
|
32
|
+
# @param [Array<String, Symbol>] keywords List of keyword arguments
|
33
|
+
# accepted by the method.
|
34
|
+
#
|
35
|
+
# @return [RespondToMatcher] self
|
36
|
+
# @overload with count, *keywords
|
37
|
+
# Adds a parameter count expectation and one or more keyword
|
38
|
+
# expectations (Ruby 2.0 only).
|
39
|
+
#
|
40
|
+
# @param [Integer, Range, nil] count (optional) The number of expected
|
41
|
+
# parameters.
|
42
|
+
# @param [Array<String, Symbol>] keywords List of keyword arguments
|
43
|
+
# accepted by the method.
|
44
|
+
#
|
45
|
+
# @return [RespondToMatcher] self
|
46
|
+
def with *keywords
|
47
|
+
@expected_arity = keywords.shift if Integer === keywords.first || Range === keywords.first
|
33
48
|
@expected_keywords = keywords
|
34
49
|
self
|
35
50
|
end # method with
|
@@ -45,7 +45,7 @@ module RSpec::SleepingKingStudios::Matchers::Core
|
|
45
45
|
# specified value using :property=, then compare the value from :property
|
46
46
|
# with the specified value.
|
47
47
|
#
|
48
|
-
# @
|
48
|
+
# @param [Object] value the value to set and then compare
|
49
49
|
#
|
50
50
|
# @return [HavePropertyMatcher] self
|
51
51
|
def with value
|
@@ -39,7 +39,7 @@ module RSpec::SleepingKingStudios::Matchers::Core
|
|
39
39
|
# Sets a value expectation. The matcher will compare the value from
|
40
40
|
# :property with the specified value.
|
41
41
|
#
|
42
|
-
# @
|
42
|
+
# @param [Object] value the value to compare
|
43
43
|
#
|
44
44
|
# @return [HaveReaderMatcher] self
|
45
45
|
def with value
|
@@ -51,7 +51,7 @@ module RSpec::SleepingKingStudios::Matchers::Core
|
|
51
51
|
# evaluates the block and the value is compared to the specified value
|
52
52
|
# instead of using :property.
|
53
53
|
#
|
54
|
-
# @
|
54
|
+
# @param [Object] value the value to compare
|
55
55
|
#
|
56
56
|
# @yield if a block is provided, the block is used to check the value after
|
57
57
|
# setting :property= instead of using :property.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-sleeping_king_studios
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.rc.
|
4
|
+
version: 1.0.0.rc.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob "Merlin" Smith
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: 1.3.1
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.0.
|
146
|
+
rubygems_version: 2.0.6
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: A collection of RSpec patches and custom matchers.
|