rspec-sleeping_king_studios 1.0.0.rc.2 → 1.0.0.rc.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a201081c88d39452f78afa3150316e817901a52d
4
- data.tar.gz: 1ea674d3e88024e1d945b17e1ecd10d5c09d722a
3
+ metadata.gz: c08fc787018b6d170c2377aa29f486a15140ec51
4
+ data.tar.gz: 0990079313ec742c6055508f030b7c4222020827
5
5
  SHA512:
6
- metadata.gz: ee4bdd1817d0d128b1e30304be501c63990545464bb7fa69dc272939073f487f26e5c32480aa7d00324c4d32d24a2cbc27738bb8ec374a671801ff09c03c1756
7
- data.tar.gz: 8003b45634d319d7619a712dfece3d51df24e91394c294667e64e26e73770a2b99d6ae8986ded60be8902a055f5829a1fc25777d16f5a281d8ec2a404a47b523
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, Range, or nil argument, and zero or more
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
- # Adds a parameter count expectation and/or one or more keyword
23
- # expectations (Ruby 2.0 only).
22
+ # @overload with count
23
+ # Adds a parameter count expectation.
24
24
  #
25
- # @param [Integer, Range, nil] count the number of expected parameters; can
26
- # be an integer, a range, or nil (parameter count is ignored)
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
- # @return [RespondToMatcher] self
31
- def with count = nil, *keywords
32
- @expected_arity = count unless count.nil?
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
- # @params [Object] value the value to set and then compare
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
- # @params [Object] value the value to compare
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
- # @params [Object] value the value to compare
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.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module SleepingKingStudios
5
- VERSION = '1.0.0.rc.2'
5
+ VERSION = '1.0.0.rc.3'
6
6
  end # module
7
7
  end # module
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.2
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.3
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.