rspec-be_valid_when_matcher 1.2.1 → 1.2.2

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: 23a4554e916faef5bc3767c5546b6c980d897cd6
4
- data.tar.gz: ef6fb682fe36903f22dc64cb664edbcf0df83a9c
3
+ metadata.gz: 8a51cd06a0053593f3c236b4bf3dd0c587de5b22
4
+ data.tar.gz: 001694ddb849dd300bb620a23d3a08ffa940bcb4
5
5
  SHA512:
6
- metadata.gz: 411253855967a78d024211d403f96a802088efe114f4ccaaf5943d41c89367abe8424ddcd47531e039bc221d7e85323d4215fd9291af77c88a80489958f3d606
7
- data.tar.gz: 3d3ab58ba4e831c3a1257b50b74ce6f1ab7fb3dea60055cc9ab19d45080ec12225cac89ac14877799e8a78d58342df4ab876447643f4f1a751fa5bc7793a3470
6
+ metadata.gz: 8d92240032d58d6268143670a36b9b60ff54c74300cb8e36ec4221f5940a99ed42f8d23a1929720c238aeee639ef7fd17cae4e200835decb78b6b11ffd7e3ebe
7
+ data.tar.gz: ea5ad7670cf4d843eabb546c34c2ee54626d80d3de6a92b1706ad8c945e0e76b5a685680f4ebc25839687343197c04acffe199bad13f1ae4007c3b374d778168
data/README.md CHANGED
@@ -10,6 +10,8 @@ https://codeclimate.com/github/mtuchowski/rspec-be_valid_when_matcher)
10
10
  https://codeclimate.com/github/mtuchowski/rspec-be_valid_when_matcher/coverage)
11
11
  [![Inline docs](http://inch-ci.org/github/mtuchowski/rspec-be_valid_when_matcher.svg?branch=master)](
12
12
  http://inch-ci.org/github/mtuchowski/rspec-be_valid_when_matcher)
13
+ [![Dependency Status](https://gemnasium.com/mtuchowski/rspec-be_valid_when_matcher.svg)](
14
+ https://gemnasium.com/mtuchowski/rspec-be_valid_when_matcher)
13
15
 
14
16
  RSpec matcher for testing ActiveRecord models with a fluent and clear language.
15
17
 
@@ -15,7 +15,7 @@ module RSpec
15
15
  # @raise ArgumentError if field name is not a symbol.
16
16
  def initialize(field)
17
17
  unless field.instance_of? Symbol
18
- fail ArgumentError, "field name should be symbol (#{field.inspect})"
18
+ raise ArgumentError, "field name should be symbol (#{field.inspect})"
19
19
  end
20
20
 
21
21
  @field = field
@@ -93,7 +93,8 @@ module RSpec
93
93
  number_of_arguments = args.size
94
94
 
95
95
  if number_of_arguments > 2 || number_of_arguments == 0
96
- fail ArgumentError, "wrong number of arguments (#{number_of_arguments} insted of 1 or 2)"
96
+ raise ArgumentError, "wrong number of arguments (#{number_of_arguments}
97
+ insted of 1 or 2)"
97
98
  else
98
99
  self.value = args.shift
99
100
  @message = args.first
@@ -124,7 +125,7 @@ module RSpec
124
125
  symbol: { value: :value, type: Symbol },
125
126
  range: { value: 2..42, type: Range } }.each do |name, properties|
126
127
  define_method "is_#{name}" do |value = properties[:value]|
127
- fail ArgumentError, "should be #{name}" unless value.is_a? properties[:type]
128
+ raise ArgumentError, "should be #{name}" unless value.is_a? properties[:type]
128
129
 
129
130
  is(value, "a #{name}")
130
131
  end
@@ -150,11 +151,11 @@ module RSpec
150
151
  end
151
152
 
152
153
  def assert_value_existence
153
- fail ArgumentError, 'missing value' unless @value_set
154
+ raise ArgumentError, 'missing value' unless @value_set
154
155
  end
155
156
 
156
157
  def assert_model_existance
157
- fail ArgumentError, 'missing model' if @model.nil?
158
+ raise ArgumentError, 'missing model' if @model.nil?
158
159
  end
159
160
 
160
161
  def setup_model(model)
@@ -1,119 +1,119 @@
1
1
  example_id | status | run_time |
2
2
  ------------------------------------------------------ | ------ | --------------- |
3
- ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:1] | passed | 0.00556 seconds |
4
- ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:2] | passed | 0.00013 seconds |
3
+ ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:1] | passed | 0.00514 seconds |
4
+ ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:2] | passed | 0.00012 seconds |
5
5
  ./spec/rspec/be_valid_when/is_not_present_spec.rb[1:3] | passed | 0.00023 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.00284 seconds |
8
- ./spec/rspec/be_valid_when/is_spec.rb[1:3:1] | passed | 0.00275 seconds |
9
- ./spec/rspec/be_valid_when/is_spec.rb[1:3:2] | passed | 0.00097 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:1:1:1] | passed | 0.01034 seconds |
12
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:1:2] | passed | 0.00016 seconds |
13
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:1] | passed | 0.01103 seconds |
14
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:2] | passed | 0.00013 seconds |
15
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:3] | passed | 0.00023 seconds |
16
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:1:1] | passed | 0.00982 seconds |
17
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:1:2] | passed | 0.00012 seconds |
18
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:1] | passed | 0.01042 seconds |
19
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:2] | passed | 0.00014 seconds |
20
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:3] | passed | 0.00025 seconds |
21
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:1] | passed | 0.05393 seconds |
22
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:2] | passed | 0.00063 seconds |
23
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:1] | passed | 0.01105 seconds |
6
+ ./spec/rspec/be_valid_when/is_spec.rb[1:1] | passed | 0.00026 seconds |
7
+ ./spec/rspec/be_valid_when/is_spec.rb[1:2:1] | passed | 0.00477 seconds |
8
+ ./spec/rspec/be_valid_when/is_spec.rb[1:3:1] | passed | 0.00264 seconds |
9
+ ./spec/rspec/be_valid_when/is_spec.rb[1:3:2] | passed | 0.00081 seconds |
10
+ ./spec/rspec/be_valid_when/is_spec.rb[1:4] | passed | 0.00013 seconds |
11
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:1:1] | passed | 0.00962 seconds |
12
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:1:2] | passed | 0.00012 seconds |
13
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:1] | passed | 0.01027 seconds |
14
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:2] | passed | 0.00012 seconds |
15
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:1:2:3] | passed | 0.00018 seconds |
16
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:1:1] | passed | 0.00964 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.01066 seconds |
19
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:2] | passed | 0.00013 seconds |
20
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:2:2:3] | passed | 0.00027 seconds |
21
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:1] | passed | 0.00984 seconds |
22
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:1:2] | passed | 0.00012 seconds |
23
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:1] | passed | 0.01024 seconds |
24
24
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:2] | passed | 0.00013 seconds |
25
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:3] | passed | 0.00113 seconds |
26
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:1] | passed | 0.01061 seconds |
27
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:2] | passed | 0.00014 seconds |
28
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:1] | passed | 0.01168 seconds |
29
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:2] | passed | 0.00015 seconds |
30
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:3] | passed | 0.00032 seconds |
31
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:1:1] | passed | 0.01165 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.01014 seconds |
25
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:3:2:3] | passed | 0.00027 seconds |
26
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:1] | passed | 0.00984 seconds |
27
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:1:2] | passed | 0.00018 seconds |
28
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:4:2:1] | passed | 0.01001 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.00028 seconds |
31
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:1:1] | passed | 0.01427 seconds |
32
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:1:2] | passed | 0.00016 seconds |
33
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:1] | passed | 0.01257 seconds |
34
34
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:5:2:2] | passed | 0.00014 seconds |
35
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.01039 seconds |
37
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:1:2] | passed | 0.00015 seconds |
38
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:1] | passed | 0.01121 seconds |
39
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:2] | passed | 0.00014 seconds |
40
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:3] | passed | 0.00036 seconds |
41
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:1] | passed | 0.00997 seconds |
42
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:2] | passed | 0.00012 seconds |
43
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:1] | passed | 0.01092 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.00024 seconds |
46
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:1:1] | passed | 0.01221 seconds |
36
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:1:1] | passed | 0.00954 seconds |
37
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:1:2] | passed | 0.00012 seconds |
38
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:6:2:1] | passed | 0.00967 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.00026 seconds |
41
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:1] | passed | 0.04052 seconds |
42
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:1:2] | passed | 0.00074 seconds |
43
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:1] | passed | 0.0103 seconds |
44
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:2] | passed | 0.00015 seconds |
45
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:7:2:3] | passed | 0.00109 seconds |
46
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:1:1] | passed | 0.00958 seconds |
47
47
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:1:2] | passed | 0.00016 seconds |
48
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:1] | passed | 0.01232 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.00043 seconds |
51
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:1:1] | passed | 0.01072 seconds |
52
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:1:2] | passed | 0.00014 seconds |
53
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:1] | passed | 0.01225 seconds |
54
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:2] | passed | 0.00012 seconds |
55
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:3] | passed | 0.0003 seconds |
56
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:1] | passed | 0.01177 seconds |
57
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:2] | passed | 0.00014 seconds |
58
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:1] | passed | 0.01105 seconds |
59
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:2] | passed | 0.00014 seconds |
60
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:3] | passed | 0.0003 seconds |
61
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:1:1] | passed | 0.0115 seconds |
62
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:1:2] | passed | 0.00014 seconds |
63
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:1] | passed | 0.0117 seconds |
64
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:2] | passed | 0.00012 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.01134 seconds |
67
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:1:2] | passed | 0.00013 seconds |
68
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:1] | passed | 0.01124 seconds |
69
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:2] | passed | 0.00017 seconds |
48
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:1] | passed | 0.01034 seconds |
49
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:2] | passed | 0.00014 seconds |
50
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:8:2:3] | passed | 0.00026 seconds |
51
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:1:1] | passed | 0.00929 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.01107 seconds |
54
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:2] | passed | 0.00011 seconds |
55
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:9:2:3] | passed | 0.00025 seconds |
56
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:1] | passed | 0.00995 seconds |
57
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:1:2] | passed | 0.00012 seconds |
58
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:1] | passed | 0.01232 seconds |
59
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:2] | passed | 0.00012 seconds |
60
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:10:2:3] | passed | 0.00024 seconds |
61
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:1:1] | passed | 0.01046 seconds |
62
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:1:2] | passed | 0.00012 seconds |
63
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:1] | passed | 0.01077 seconds |
64
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:2] | passed | 0.00013 seconds |
65
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:11:2:3] | passed | 0.00027 seconds |
66
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:1:1] | passed | 0.01053 seconds |
67
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:1:2] | passed | 0.00012 seconds |
68
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:1] | passed | 0.01112 seconds |
69
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:2] | passed | 0.00013 seconds |
70
70
  ./spec/rspec/be_valid_when/is_type_spec.rb[1:12:2:3] | passed | 0.00026 seconds |
71
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:1] | passed | 0.01084 seconds |
72
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:2] | passed | 0.00014 seconds |
73
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:1] | passed | 0.01111 seconds |
74
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:2] | passed | 0.00013 seconds |
75
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:3] | passed | 0.00026 seconds |
76
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:1:1] | passed | 0.01294 seconds |
77
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:1:2] | passed | 0.00021 seconds |
78
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:1] | passed | 0.01252 seconds |
79
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:2] | passed | 0.00014 seconds |
80
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:3] | passed | 0.00025 seconds |
81
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:15:1] | passed | 0.01086 seconds |
82
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:15:2] | passed | 0.00013 seconds |
83
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:16:1] | passed | 0.01151 seconds |
84
- ./spec/rspec/be_valid_when/is_type_spec.rb[1:16:2] | passed | 0.00015 seconds |
85
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:1] | passed | 0.00031 seconds |
86
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:2] | passed | 0.00008 seconds |
71
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:1] | passed | 0.01115 seconds |
72
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:1:2] | passed | 0.00013 seconds |
73
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:1] | passed | 0.01074 seconds |
74
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:2] | passed | 0.00012 seconds |
75
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:13:2:3] | passed | 0.00027 seconds |
76
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:1:1] | passed | 0.01062 seconds |
77
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:1:2] | passed | 0.00012 seconds |
78
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:1] | passed | 0.01095 seconds |
79
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:2] | passed | 0.00012 seconds |
80
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:14:2:3] | passed | 0.00026 seconds |
81
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:15:1] | passed | 0.01055 seconds |
82
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:15:2] | passed | 0.00012 seconds |
83
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:16:1] | passed | 0.01128 seconds |
84
+ ./spec/rspec/be_valid_when/is_type_spec.rb[1:16:2] | passed | 0.00011 seconds |
85
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:1] | passed | 0.00035 seconds |
86
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:2] | passed | 0.0002 seconds |
87
87
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:3] | passed | 0.00009 seconds |
88
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:4] | passed | 0.00066 seconds |
89
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:5] | passed | 0.00009 seconds |
88
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:4] | passed | 0.00008 seconds |
89
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:5] | passed | 0.00053 seconds |
90
90
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:6] | passed | 0.00008 seconds |
91
91
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:7] | passed | 0.00008 seconds |
92
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:8] | passed | 0.00008 seconds |
93
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:9] | passed | 0.00007 seconds |
94
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:10] | passed | 0.00007 seconds |
95
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:1] | passed | 0.00011 seconds |
96
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:2] | passed | 0.00013 seconds |
97
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:1] | passed | 0.00011 seconds |
98
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:2] | passed | 0.00013 seconds |
99
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:3] | passed | 0.00011 seconds |
100
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:4] | passed | 0.00011 seconds |
101
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:5] | passed | 0.00014 seconds |
102
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:1] | passed | 0.00009 seconds |
103
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:1] | passed | 0.0008 seconds |
104
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:2] | passed | 0.00077 seconds |
92
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:8] | passed | 0.0001 seconds |
93
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:9] | passed | 0.0002 seconds |
94
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:1:10] | passed | 0.00008 seconds |
95
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:1] | passed | 0.00009 seconds |
96
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:2] | passed | 0.00011 seconds |
97
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:1] | passed | 0.0001 seconds |
98
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:2] | passed | 0.00009 seconds |
99
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:3] | passed | 0.00009 seconds |
100
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:4] | passed | 0.0001 seconds |
101
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:2:3:5] | passed | 0.00009 seconds |
102
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:1] | passed | 0.00008 seconds |
103
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:1] | passed | 0.00065 seconds |
104
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:3:2:2] | passed | 0.00066 seconds |
105
105
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:1] | passed | 0.00008 seconds |
106
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:2:1] | passed | 0.00077 seconds |
107
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:2:2] | passed | 0.00076 seconds |
108
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:5] | passed | 0.0001 seconds |
109
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:1] | passed | 0.00013 seconds |
110
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:2] | passed | 0.00014 seconds |
111
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:3] | passed | 0.00009 seconds |
106
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:2:1] | passed | 0.00065 seconds |
107
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:4:2:2] | passed | 0.00066 seconds |
108
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:5] | passed | 0.00009 seconds |
109
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:1] | passed | 0.00012 seconds |
110
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:2] | passed | 0.00013 seconds |
111
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:3] | passed | 0.0001 seconds |
112
112
  ./spec/rspec/be_valid_when_matcher_spec.rb[1:6:4] | passed | 0.00009 seconds |
113
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:1] | passed | 0.00083 seconds |
114
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:2] | passed | 0.00201 seconds |
115
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:1] | passed | 0.00082 seconds |
116
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:2] | passed | 0.00199 seconds |
117
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:1] | passed | 0.00081 seconds |
118
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:2:1] | passed | 0.00093 seconds |
119
- ./spec/rspec/be_valid_when_matcher_spec.rb[1:9:1] | passed | 0.00013 seconds |
113
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:1] | passed | 0.00069 seconds |
114
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:1:2] | passed | 0.00172 seconds |
115
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:1] | passed | 0.00064 seconds |
116
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:7:2:2] | passed | 0.00176 seconds |
117
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:1] | passed | 0.00078 seconds |
118
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:8:2:1] | passed | 0.00074 seconds |
119
+ ./spec/rspec/be_valid_when_matcher_spec.rb[1:9:1] | passed | 0.00011 seconds |
@@ -14,8 +14,8 @@ RSpec.shared_examples 'sets the field value' do
14
14
  expect { subject.matches? model }.not_to raise_error
15
15
  expect { subject.does_not_match? model }.not_to raise_error
16
16
 
17
- expect(subject.matches? model).to eq true
18
- expect(subject.does_not_match? model).to eq false
17
+ expect(subject.matches?(model)).to eq true
18
+ expect(subject.does_not_match?(model)).to eq false
19
19
 
20
20
  expect { subject.description }.not_to raise_error
21
21
  end
@@ -47,11 +47,11 @@ class FakeModelFoo
47
47
  end
48
48
 
49
49
  def array_field_cannot_be_empty
50
- errors.add(:array_field, "can't be empty") if !array_field.nil? && array_field.length == 0
50
+ errors.add(:array_field, "can't be empty") if !array_field.nil? && array_field.empty?
51
51
  end
52
52
 
53
53
  def hash_field_cannot_be_empty
54
- errors.add(:hash_field, "can't be empty") if !hash_field.nil? && hash_field.keys.length == 0
54
+ errors.add(:hash_field, "can't be empty") if !hash_field.nil? && hash_field.keys.empty?
55
55
  end
56
56
 
57
57
  def symbol_field_cannot_be_short
@@ -58,11 +58,11 @@ describe 'be_valid_when' do
58
58
  subject { be_valid_when :field }
59
59
 
60
60
  it 'should fail on #matches?' do
61
- expect { subject.matches? model }.to raise_error ArgumentError
61
+ expect { subject.matches?(model) }.to raise_error ArgumentError
62
62
  end
63
63
 
64
64
  it 'should fail on #does_not_match?' do
65
- expect { subject.does_not_match? model }.to raise_error ArgumentError
65
+ expect { subject.does_not_match?(model) }.to raise_error ArgumentError
66
66
  end
67
67
 
68
68
  it 'should fail on #failure_message' do
@@ -88,11 +88,11 @@ describe 'be_valid_when' do
88
88
  subject { be_valid_when :field, 'value' }
89
89
 
90
90
  it 'should not fail on #matches?' do
91
- expect { subject.matches? model }.not_to raise_error
91
+ expect { subject.matches?(model) }.not_to raise_error
92
92
  end
93
93
 
94
94
  it 'should not fail on #does_not_match?' do
95
- expect { subject.does_not_match? model }.not_to raise_error
95
+ expect { subject.does_not_match?(model) }.not_to raise_error
96
96
  end
97
97
  end
98
98
  end
@@ -106,11 +106,11 @@ describe 'be_valid_when' do
106
106
  subject { be_valid_when :field, 'value', 'some text' }
107
107
 
108
108
  it 'should not fail on #matches?' do
109
- expect { subject.matches? model }.not_to raise_error
109
+ expect { subject.matches?(model) }.not_to raise_error
110
110
  end
111
111
 
112
112
  it 'should not fail on #does_not_match?' do
113
- expect { subject.does_not_match? model }.not_to raise_error
113
+ expect { subject.does_not_match?(model) }.not_to raise_error
114
114
  end
115
115
  end
116
116
  end
@@ -147,26 +147,26 @@ describe 'be_valid_when' do
147
147
  context 'using #matches?' do
148
148
  it 'is setting the proper field using the provided value' do
149
149
  model.field = nil
150
- subject.is('value').matches? model
150
+ subject.is('value').matches?(model)
151
151
  expect(model.field).to eq 'value'
152
152
  end
153
153
 
154
154
  it 'returns proper result' do
155
- expect(subject.is('value').matches? model).to eq true
156
- expect(subject.is(nil).matches? model).to eq false
155
+ expect(subject.is('value').matches?(model)).to eq true
156
+ expect(subject.is(nil).matches?(model)).to eq false
157
157
  end
158
158
  end
159
159
 
160
160
  context 'using #does_not_match?' do
161
161
  it 'is setting the proper field using the provided value' do
162
162
  model.field = nil
163
- subject.is('value').does_not_match? model
163
+ subject.is('value').does_not_match?(model)
164
164
  expect(model.field).to eq 'value'
165
165
  end
166
166
 
167
167
  it 'returns proper result' do
168
- expect(subject.is('value').does_not_match? model).to eq false
169
- expect(subject.is(nil).does_not_match? model).to eq true
168
+ expect(subject.is('value').does_not_match?(model)).to eq false
169
+ expect(subject.is(nil).does_not_match?(model)).to eq true
170
170
  end
171
171
  end
172
172
  end
@@ -1,8 +1,8 @@
1
1
  RSpec.shared_examples 'returns proper results' do
2
2
  it 'returns proper result' do
3
- expect(passing_matcher.matches? model).to eq true
4
- expect(passing_matcher.does_not_match? model).to eq false
5
- expect(failing_matcher.matches? model).to eq false
6
- expect(failing_matcher.does_not_match? model).to eq true
3
+ expect(passing_matcher.matches?(model)).to eq true
4
+ expect(passing_matcher.does_not_match?(model)).to eq false
5
+ expect(failing_matcher.matches?(model)).to eq false
6
+ expect(failing_matcher.does_not_match?(model)).to eq true
7
7
  end
8
8
  end
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.2.1
4
+ version: 1.2.2
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-12-10 00:00:00.000000000 Z
11
+ date: 2016-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -80,18 +80,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.4.8
83
+ rubygems_version: 2.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: RSpec be_valid_when matcher for ActiveRecord models.
87
87
  test_files:
88
+ - spec/rspec/be_valid_when/is_not_present_spec.rb
89
+ - spec/rspec/be_valid_when/is_spec.rb
90
+ - spec/rspec/be_valid_when/is_type_spec.rb
91
+ - spec/rspec/be_valid_when_matcher_spec.rb
92
+ - spec/spec_helper.rb
88
93
  - spec/examples.cache
89
- - spec/support/takes_no_arguments.rb
90
94
  - spec/support/returns_proper_results.rb
91
95
  - spec/support/has_correct_description.rb
92
- - spec/spec_helper.rb
93
- - spec/rspec/be_valid_when/is_type_spec.rb
94
- - spec/rspec/be_valid_when/is_spec.rb
95
- - spec/rspec/be_valid_when/is_not_present_spec.rb
96
- - spec/rspec/be_valid_when_matcher_spec.rb
96
+ - spec/support/takes_no_arguments.rb
97
97
  has_rdoc: