rspec-be_valid_when_matcher 1.0.0 → 1.0.1

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: 13cf6df391015ff30c249f2712a745dcee089f4e
4
- data.tar.gz: 898eadd1e2b5a56c6a22bb49112725d28de32a6b
3
+ metadata.gz: 4ecb1390a1f1dd5222d60871c22e883974a42650
4
+ data.tar.gz: 8ca1889bf00f7410e351ac352375e660f9b4e3c4
5
5
  SHA512:
6
- metadata.gz: f49b94989edc31bef1f44bf8e045447eb5f8c845b3840959681b11e2ff20a697390e691b5102de06e099316ab60a6f15d6cb8a2585c769c39b1969a54276942a
7
- data.tar.gz: 05350d0b199501706dda7fc640c03f3c51c319070344f17d7cd226c52ea38dab6659dcdefa679310761d38102f64fe4babb939a2a0ad26a4ca11f713388901af
6
+ metadata.gz: 8bb28772fea0c5e1e3169cd4b6abbc927b3d07834e471e953ddae10b845887d57d5f4bdbda697a229794b0bbe6d8151e776efaa11894c3861b9408bd8ad0ed6c
7
+ data.tar.gz: 9c862a67333aeb3234ffe1bf8685fb768953afa343759dfb47b6dcf853591cee62a5711a1a29d30877931b4336044e5e8da96753aee81b7c7a2feb314a0e0d3a
data/README.md CHANGED
@@ -1,9 +1,13 @@
1
1
  # rspec-be_valid_when_matcher
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/rspec-be_valid_when_matcher.svg)]
4
- (http://badge.fury.io/rb/rspec-be_valid_when_matcher)
5
- [![Build Status](https://travis-ci.org/mtuchowski/rspec-be_valid_when_matcher.svg)]
6
- (https://travis-ci.org/mtuchowski/rspec-be_valid_when_matcher)
3
+ [![Gem Version](https://badge.fury.io/rb/rspec-be_valid_when_matcher.svg)](
4
+ http://badge.fury.io/rb/rspec-be_valid_when_matcher)
5
+ [![Build Status](https://travis-ci.org/mtuchowski/rspec-be_valid_when_matcher.svg)](
6
+ https://travis-ci.org/mtuchowski/rspec-be_valid_when_matcher)
7
+ [![Code Climate](https://codeclimate.com/github/mtuchowski/rspec-be_valid_when_matcher/badges/gpa.svg)](
8
+ https://codeclimate.com/github/mtuchowski/rspec-be_valid_when_matcher)
9
+ [![Test Coverage](https://codeclimate.com/github/mtuchowski/rspec-be_valid_when_matcher/badges/coverage.svg)](
10
+ https://codeclimate.com/github/mtuchowski/rspec-be_valid_when_matcher/coverage)
7
11
 
8
12
  RSpec matcher for testing ActiveRecord models with a fluent and clear language.
9
13
 
@@ -6,8 +6,6 @@ require 'bigdecimal'
6
6
  module RSpec
7
7
  # Container module for be_valid_when matcher definition and implementation.
8
8
  module BeValidWhenMatcher
9
- # rubocop:disable Style/PredicateName
10
-
11
9
  # Provides the implementation for `be_valid_when` matcher.
12
10
  # Not intended to be instantiated directly.
13
11
  # @api private
@@ -32,7 +30,6 @@ module RSpec
32
30
  # {http://api.rubyonrails.org/classes/ActiveModel/Validations.html#method-i-errors `errors`}
33
31
  # on specified `field` after setting it's `value` and validating it. Does not take into
34
32
  # account other fields and the validity of the whole object.
35
- # @api private
36
33
  # @param model [Object] an Object implementing `ActiveModel::Validations`.
37
34
  # @return [Boolean] `true` if there are no errors on `field`, `false` otherwise.
38
35
  def matches?(model)
@@ -46,7 +43,6 @@ module RSpec
46
43
  # {http://api.rubyonrails.org/classes/ActiveModel/Validations.html#method-i-errors `errors`}
47
44
  # on specified `field` after setting it's `value` and validating it. Does not take into
48
45
  # account other fields.
49
- # @api private
50
46
  # @param model [Object] an Object implementing `ActiveModel::Validations`.
51
47
  # @return [Boolean] `true` if there are errors on `field`, `false` otherwise.
52
48
  def does_not_match?(model)
@@ -55,7 +51,6 @@ module RSpec
55
51
  end
56
52
 
57
53
  # Called when {#matches?} returns false.
58
- # @api private
59
54
  # @return [String] explaining what was expected.
60
55
  def failure_message
61
56
  assert_value_existence
@@ -65,7 +60,6 @@ module RSpec
65
60
  end
66
61
 
67
62
  # Called when {#does_not_match?} returns false.
68
- # @api private
69
63
  # @return [String] explaining what was expected.
70
64
  def failure_message_when_negated
71
65
  assert_value_existence
@@ -75,7 +69,6 @@ module RSpec
75
69
  end
76
70
 
77
71
  # Used to generate the example's doc string in one-liner syntax.
78
- # @api private
79
72
  # @return [String] short description of what is expected.
80
73
  def description
81
74
  assert_value_existence
@@ -84,29 +77,18 @@ module RSpec
84
77
  end
85
78
 
86
79
  # Indicates that this matcher doesn't provide actual and expected attributes.
87
- # @api private
88
80
  # @return [FalseClass]
89
81
  def diffable?
90
82
  false
91
83
  end
92
84
 
93
85
  # Indicates that this matcher cannot be used in a block expectation expression.
94
- # @api private
95
86
  # @return [FalseClass]
96
87
  def supports_block_expectations?
97
88
  false
98
89
  end
99
90
 
100
- # Used to set field `value` and optional custom failure `message`.
101
- # @overload is(value)
102
- # Sets the field `value`.
103
- # @param value [Any] field `value` to use in matching.
104
- # @overload is(value, message)
105
- # Sets the field `value` and custom failure `message`.
106
- # @param value [Any] field `value` to use in matching.
107
- # @param message [String] a `message` used for {#failure_message},
108
- # {#failure_message_when_negated} and {#description}.
109
- # @return [self]
91
+ # @see BeValidWhenMatcher#is
110
92
  def is(*args)
111
93
  number_of_arguments = args.size
112
94
 
@@ -120,7 +102,8 @@ module RSpec
120
102
  self
121
103
  end
122
104
 
123
- # Used to setup matcher for checking `nil` `value`.
105
+ # rubocop:disable Style/PredicateName
106
+ # @see BeValidWhenMatcher#is_not_present
124
107
  def is_not_present
125
108
  is(nil, 'not present')
126
109
  end
@@ -187,6 +170,22 @@ module RSpec
187
170
  end
188
171
 
189
172
  # Model validity assertion.
173
+ #
174
+ # @overload be_valid_when(field)
175
+ # @param field (Symbol) field name to use.
176
+ #
177
+ # @overload be_valid_when(field, value)
178
+ # @param field (Symbol) field name to use.
179
+ # @param value (Any) field `value` to use in matching.
180
+ #
181
+ # @overload be_valid_when(field, value, message)
182
+ # @param field (Symbol) field name to use.
183
+ # @param value (Any) field `value` to use in matching.
184
+ # @param message [String] a `message` used for failure message.
185
+ #
186
+ # @raise [ArgumentError] if field name is not a symbol.
187
+ # @raise [ArgumentError] if invoked with more than three parameters.
188
+ # @return [self]
190
189
  def be_valid_when(*args)
191
190
  number_of_arguments = args.size
192
191
  field_name = args.shift
@@ -197,5 +196,134 @@ module RSpec
197
196
  BeValidWhen.new(field_name).is(*args)
198
197
  end
199
198
  end
199
+
200
+ # @!group Basic chaining
201
+
202
+ # @!method is(*args)
203
+ # Used to set field `value` and optional custom failure `message`.
204
+ #
205
+ # @overload is(value)
206
+ # Sets the field `value`.
207
+ # @param value [Any] field `value` to use in matching.
208
+ # @example
209
+ # it { is_expected.to be_valid_when(:field).is(true) }
210
+ #
211
+ # @overload is(value, message)
212
+ # Sets the field `value` and custom failure `message`.
213
+ # @param value [Any] field `value` to use in matching.
214
+ # @param message [String] a `message` used for failure message.
215
+ # @example
216
+ # it { is_expected.to be_valid_when(:field).is(42, 'magic number') }
217
+ #
218
+ # @raise [ArgumentError] if invoked without passing `value` parameter.
219
+ # @raise [ArgumentError] if invoked with more than two parameters.
220
+ # @return [self]
221
+
222
+ # @!endgroup
223
+
224
+ # @!group Presence
225
+
226
+ # @!method is_not_present()
227
+ # Used to setup matcher for checking `nil` value.
228
+ # @example
229
+ # it { is_expected.to be_valid_when(:field).is_not_present }
230
+ # @return [self]
231
+
232
+ # @!endgroup
233
+
234
+ # @!group Type
235
+
236
+ # @!method is_numeric(value = 42)
237
+ # Setup matcher for checking numeric values.
238
+ # @raise [ArgumentError] if given non `Numeric` value.
239
+ # @example
240
+ # it { is_expected.to be_valid_when(:field).is_numeric }
241
+ # @return [self]
242
+
243
+ # @!method is_integer(value = 42)
244
+ # Setup matcher for checking integer values.
245
+ # @raise [ArgumentError] if given non `Integer` value.
246
+ # @example
247
+ # it { is_expected.to be_valid_when(:field).is_integer }
248
+ # @return [self]
249
+
250
+ # @!method is_fixnum(value = 42)
251
+ # Setup matcher for checking fixnum values.
252
+ # @raise [ArgumentError] if given non `Fixnum` value.
253
+ # @example
254
+ # it { is_expected.to be_valid_when(:field).is_fixnum }
255
+ # @return [self]
256
+
257
+ # @!method is_bignum(value = 42**13)
258
+ # Setup matcher for checking bignum values.
259
+ # @raise [ArgumentError] if given non `Bignum` value.
260
+ # @example
261
+ # it { is_expected.to be_valid_when(:field).is_bignum }
262
+ # @return [self]
263
+
264
+ # @!method is_float(value = 3.14)
265
+ # Setup matcher for checking float values.
266
+ # @raise [ArgumentError] if given non `Float` value.
267
+ # @example
268
+ # it { is_expected.to be_valid_when(:field).is_float }
269
+ # @return [self]
270
+
271
+ # @!method is_complex(value = 42+0i)
272
+ # Setup matcher for checking complex values.
273
+ # @raise [ArgumentError] if given non `Complex` value.
274
+ # @example
275
+ # it { is_expected.to be_valid_when(:field).is_complex }
276
+ # @return [self]
277
+
278
+ # @!method is_rational(value = 42/1)
279
+ # Setup matcher for checking rational values.
280
+ # @raise [ArgumentError] if given non `Rational` value.
281
+ # @example
282
+ # it { is_expected.to be_valid_when(:field).is_rational }
283
+ # @return [self]
284
+
285
+ # @!method is_bigdecimal(value = 0.42E2)
286
+ # Setup matcher for checking bigdecimal values.
287
+ # @raise [ArgumentError] if given non `BigDecimal` value.
288
+ # @example
289
+ # it { is_expected.to be_valid_when(:field).is_bigdecimal }
290
+ # @return [self]
291
+
292
+ # @!method is_string(value = 'value')
293
+ # Setup matcher for checking string values.
294
+ # @raise [ArgumentError] if given non `String` value.
295
+ # @example
296
+ # it { is_expected.to be_valid_when(:field).is_string }
297
+ # @return [self]
298
+
299
+ # @!method is_regexp(value = /^value$/)
300
+ # Setup matcher for checking regexp values.
301
+ # @raise [ArgumentError] if given non `Regexp` value.
302
+ # @example
303
+ # it { is_expected.to be_valid_when(:field).is_regexp }
304
+ # @return [self]
305
+
306
+ # @!method is_array(value = [42])
307
+ # Setup matcher for checking array values.
308
+ # @raise [ArgumentError] if given non `Array` value.
309
+ # @example
310
+ # it { is_expected.to be_valid_when(:field).is_array }
311
+ # @return [self]
312
+
313
+ # @!method is_hash(value = { value: 42 })
314
+ # Setup matcher for checking hash values.
315
+ # @raise [ArgumentError] if given non `Hash` value.
316
+ # @example
317
+ # it { is_expected.to be_valid_when(:field).is_hash }
318
+ # @return [self]
319
+
320
+ # @!method is_symbol(value = :value)
321
+ # Setup matcher for checking symbol values.
322
+ # @raise [ArgumentError] if given non `Symbol` value.
323
+ # @example
324
+ # it { is_expected.to be_valid_when(:field).is_symbol }
325
+ # @return [self]
326
+
327
+ # @!endgroup
200
328
  end
201
329
  end
data/spec/examples.cache CHANGED
@@ -1,110 +1,110 @@
1
1
  example_id | status | run_time |
2
2
  ------------------------------------------------------ | ------ | --------------- |
3
- ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:1] | passed | 0.00621 seconds |
4
- ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:2] | passed | 0.00013 seconds |
5
- ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:3] | passed | 0.00028 seconds |
6
- ./spec/rspec/be_valid_when/is_spec.rb[1:1] | passed | 0.00108 seconds |
7
- ./spec/rspec/be_valid_when/is_spec.rb[1:2:1] | passed | 0.0404 seconds |
8
- ./spec/rspec/be_valid_when/is_spec.rb[1:3:1] | passed | 0.00634 seconds |
9
- ./spec/rspec/be_valid_when/is_spec.rb[1:3:2] | passed | 0.00134 seconds |
10
- ./spec/rspec/be_valid_when/is_spec.rb[1:4] | passed | 0.0001 seconds |
11
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:1:1] | passed | 0.01153 seconds |
12
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:1:2] | passed | 0.00012 seconds |
13
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:1] | passed | 0.01104 seconds |
3
+ ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:1] | passed | 0.01317 seconds |
4
+ ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:2] | passed | 0.00033 seconds |
5
+ ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:3] | passed | 0.00069 seconds |
6
+ ./spec/rspec/be_valid_when/is_spec.rb[1:1] | passed | 0.0001 seconds |
7
+ ./spec/rspec/be_valid_when/is_spec.rb[1:2:1] | passed | 0.00277 seconds |
8
+ ./spec/rspec/be_valid_when/is_spec.rb[1:3:1] | passed | 0.00267 seconds |
9
+ ./spec/rspec/be_valid_when/is_spec.rb[1:3:2] | passed | 0.00087 seconds |
10
+ ./spec/rspec/be_valid_when/is_spec.rb[1:4] | passed | 0.00008 seconds |
11
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:1:1] | passed | 0.05099 seconds |
12
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:1:2] | passed | 0.00076 seconds |
13
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:1] | passed | 0.01303 seconds |
14
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:2] | passed | 0.00015 seconds |
15
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:3] | passed | 0.00115 seconds |
16
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:1:1] | passed | 0.0119 seconds |
17
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:1:2] | passed | 0.00013 seconds |
18
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:1] | passed | 0.01126 seconds |
14
19
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:2] | passed | 0.00013 seconds |
15
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:3] | passed | 0.00022 seconds |
16
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:1] | passed | 0.01155 seconds |
17
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:2] | passed | 0.00016 seconds |
18
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:1] | passed | 0.01095 seconds |
19
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:2] | passed | 0.00013 seconds |
20
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:3] | passed | 0.00026 seconds |
21
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:1] | passed | 0.01196 seconds |
22
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:2] | passed | 0.00015 seconds |
23
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:1] | passed | 0.01168 seconds |
24
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:2] | passed | 0.00016 seconds |
25
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:3] | passed | 0.00034 seconds |
26
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:1:1] | passed | 0.01141 seconds |
27
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:1:2] | passed | 0.00015 seconds |
28
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:1] | passed | 0.01118 seconds |
29
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:2] | passed | 0.00013 seconds |
30
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:3] | passed | 0.0003 seconds |
31
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:1:1] | passed | 0.01036 seconds |
32
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:1:2] | passed | 0.00015 seconds |
33
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:1] | passed | 0.01252 seconds |
34
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:2] | passed | 0.00013 seconds |
35
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:3] | passed | 0.00031 seconds |
36
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:1] | passed | 0.0106 seconds |
37
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:2] | passed | 0.00014 seconds |
38
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:1] | passed | 0.01111 seconds |
39
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:2] | passed | 0.00016 seconds |
40
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:3] | passed | 0.0003 seconds |
41
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:1:1] | passed | 0.0105 seconds |
42
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:1:2] | passed | 0.00011 seconds |
43
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:1] | passed | 0.01271 seconds |
44
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:2] | passed | 0.00014 seconds |
45
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:3] | passed | 0.0003 seconds |
46
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:1:1] | passed | 0.01178 seconds |
47
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:1:2] | passed | 0.00015 seconds |
48
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:1] | passed | 0.01151 seconds |
49
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:2] | passed | 0.00015 seconds |
50
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:3] | passed | 0.00026 seconds |
51
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:1] | passed | 0.0101 seconds |
52
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:2] | passed | 0.00015 seconds |
53
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:1] | passed | 0.0108 seconds |
20
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:3] | passed | 0.00028 seconds |
21
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:1] | passed | 0.01122 seconds |
22
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:2] | passed | 0.00011 seconds |
23
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:1] | passed | 0.01112 seconds |
24
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:2] | passed | 0.00012 seconds |
25
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:3] | passed | 0.00029 seconds |
26
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:1] | passed | 0.01026 seconds |
27
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:2] | passed | 0.00013 seconds |
28
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:1] | passed | 0.01107 seconds |
29
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:2] | passed | 0.00013 seconds |
30
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:3] | passed | 0.0003 seconds |
31
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:1:1] | passed | 0.01011 seconds |
32
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:1:2] | passed | 0.00014 seconds |
33
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:1] | passed | 0.01106 seconds |
34
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:2] | passed | 0.00014 seconds |
35
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:3] | passed | 0.00027 seconds |
36
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:1:1] | passed | 0.01034 seconds |
37
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:1:2] | passed | 0.00014 seconds |
38
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:1] | passed | 0.01091 seconds |
39
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:2] | passed | 0.00012 seconds |
40
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:3] | passed | 0.00028 seconds |
41
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:1] | passed | 0.01106 seconds |
42
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:2] | passed | 0.00013 seconds |
43
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:1] | passed | 0.01117 seconds |
44
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:2] | passed | 0.00014 seconds |
45
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:3] | passed | 0.00025 seconds |
46
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:1:1] | passed | 0.01021 seconds |
47
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:1:2] | passed | 0.00014 seconds |
48
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:1] | passed | 0.01087 seconds |
49
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:2] | passed | 0.00016 seconds |
50
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:3] | passed | 0.00027 seconds |
51
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:1:1] | passed | 0.01123 seconds |
52
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:1:2] | passed | 0.00012 seconds |
53
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:1] | passed | 0.01098 seconds |
54
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:2] | passed | 0.00013 seconds |
55
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:3] | passed | 0.00028 seconds |
56
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:1] | passed | 0.01248 seconds |
57
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:2] | passed | 0.00013 seconds |
58
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:1] | passed | 0.01291 seconds |
54
59
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:2] | passed | 0.00013 seconds |
55
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:3] | passed | 0.00029 seconds |
56
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:1:1] | passed | 0.01283 seconds |
60
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:3] | passed | 0.00028 seconds |
61
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:1:1] | passed | 0.01267 seconds |
57
62
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:1:2] | passed | 0.00013 seconds |
58
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:1] | passed | 0.01119 seconds |
59
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:2] | passed | 0.00013 seconds |
60
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:3] | passed | 0.00026 seconds |
61
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:1:1] | passed | 0.01163 seconds |
62
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:1:2] | passed | 0.00014 seconds |
63
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:1] | passed | 0.01164 seconds |
64
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:2] | passed | 0.00015 seconds |
65
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:3] | passed | 0.00029 seconds |
66
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:1] | passed | 0.01194 seconds |
67
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:2] | passed | 0.00013 seconds |
68
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:1] | passed | 0.01178 seconds |
63
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:1] | passed | 0.01134 seconds |
64
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:2] | passed | 0.00014 seconds |
65
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:3] | passed | 0.0003 seconds |
66
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:1:1] | passed | 0.01235 seconds |
67
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:1:2] | passed | 0.00023 seconds |
68
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:1] | passed | 0.01492 seconds |
69
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:2] | passed | 0.00013 seconds |
70
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:3] | passed | 0.00064 seconds |
71
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:1] | passed | 0.01411 seconds |
72
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:2] | passed | 0.00017 seconds |
73
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:1] | passed | 0.0146 seconds |
69
74
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:2] | passed | 0.00014 seconds |
70
75
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:3] | passed | 0.00031 seconds |
71
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:1:1] | passed | 0.0119 seconds |
72
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:1:2] | passed | 0.00014 seconds |
73
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:1] | passed | 0.01467 seconds |
74
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:2] | passed | 0.00019 seconds |
75
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:3] | passed | 0.00029 seconds |
76
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:1] | passed | 0.00029 seconds |
77
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:2] | passed | 0.00012 seconds |
78
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:3] | passed | 0.0001 seconds |
79
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:4] | passed | 0.00009 seconds |
80
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:5] | passed | 0.00009 seconds |
81
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:6] | passed | 0.00009 seconds |
82
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:7] | passed | 0.00011 seconds |
83
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:8] | passed | 0.00062 seconds |
84
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:9] | passed | 0.0001 seconds |
85
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:10] | passed | 0.00008 seconds |
86
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:1] | passed | 0.0001 seconds |
87
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:2] | passed | 0.00013 seconds |
76
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:1] | passed | 0.00058 seconds |
77
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:2] | passed | 0.0001 seconds |
78
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:3] | passed | 0.00011 seconds |
79
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:4] | passed | 0.00221 seconds |
80
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:5] | passed | 0.00008 seconds |
81
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:6] | passed | 0.00008 seconds |
82
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:7] | passed | 0.00008 seconds |
83
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:8] | passed | 0.00008 seconds |
84
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:9] | passed | 0.00008 seconds |
85
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:10] | passed | 0.00007 seconds |
86
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:1] | passed | 0.00012 seconds |
87
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:2] | passed | 0.00011 seconds |
88
88
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:1] | passed | 0.00012 seconds |
89
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:2] | passed | 0.00012 seconds |
90
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:3] | passed | 0.00012 seconds |
91
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:4] | passed | 0.00011 seconds |
89
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:2] | passed | 0.00011 seconds |
90
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:3] | passed | 0.00009 seconds |
91
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:4] | passed | 0.00009 seconds |
92
92
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:5] | passed | 0.00013 seconds |
93
93
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:1] | passed | 0.00009 seconds |
94
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:1] | passed | 0.00075 seconds |
95
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:2] | passed | 0.00079 seconds |
94
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:1] | passed | 0.00073 seconds |
95
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:2] | passed | 0.00072 seconds |
96
96
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:1] | passed | 0.00009 seconds |
97
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:2:1] | passed | 0.00081 seconds |
97
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:2:1] | passed | 0.00072 seconds |
98
98
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:2:2] | passed | 0.00078 seconds |
99
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:5] | passed | 0.00012 seconds |
100
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:1] | passed | 0.00017 seconds |
101
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:2] | passed | 0.00013 seconds |
99
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:5] | passed | 0.00115 seconds |
100
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:1] | passed | 0.00014 seconds |
101
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:2] | passed | 0.00014 seconds |
102
102
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:3] | passed | 0.0001 seconds |
103
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:4] | passed | 0.0001 seconds |
104
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:1] | passed | 0.00075 seconds |
105
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:2] | passed | 0.00203 seconds |
106
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:1] | passed | 0.00078 seconds |
107
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:2] | passed | 0.00196 seconds |
108
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:1] | passed | 0.00082 seconds |
109
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:2:1] | passed | 0.00083 seconds |
110
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:9:1] | passed | 0.00012 seconds |
103
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:4] | passed | 0.00009 seconds |
104
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:1] | passed | 0.00072 seconds |
105
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:2] | passed | 0.00196 seconds |
106
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:1] | passed | 0.00072 seconds |
107
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:2] | passed | 0.00187 seconds |
108
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:1] | passed | 0.00129 seconds |
109
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:2:1] | passed | 0.0008 seconds |
110
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:9:1] | passed | 0.0001 seconds |
data/spec/spec_helper.rb CHANGED
@@ -12,6 +12,12 @@
12
12
  #
13
13
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
14
14
 
15
+ # Setup Code Climate test reporter.
16
+ require 'codeclimate-test-reporter'
17
+
18
+ CodeClimate::TestReporter.start
19
+
20
+ # Allow using 'be_valid_when' everywhere.
15
21
  require 'rspec/be_valid_when_matcher'
16
22
 
17
23
  RSpec.configure do |config|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-be_valid_when_matcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Tuchowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec