shoulda-matchers 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/NEWS.md +10 -0
- data/gemfiles/3.0.gemfile.lock +1 -1
- data/gemfiles/3.1.gemfile.lock +1 -1
- data/gemfiles/3.2.gemfile.lock +1 -1
- data/lib/shoulda/matchers/active_model.rb +1 -0
- data/lib/shoulda/matchers/active_model/comparison_matcher.rb +52 -0
- data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +27 -3
- data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +2 -4
- data/lib/shoulda/matchers/active_model/validation_matcher.rb +4 -4
- data/lib/shoulda/matchers/active_record/association_matcher.rb +5 -1
- data/lib/shoulda/matchers/version.rb +1 -1
- data/spec/shoulda/matchers/active_model/comparison_matcher_spec.rb +40 -0
- data/spec/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +12 -5
- data/spec/shoulda/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +36 -1
- data/spec/support/fail_with_message_matcher.rb +32 -0
- metadata +35 -5
- checksums.yaml +0 -15
data/Gemfile.lock
CHANGED
data/NEWS.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# HEAD
|
2
2
|
|
3
|
+
# v 2.2.0
|
4
|
+
|
5
|
+
* Fix `have_and_belong_to_many` matcher issue for Rails 4.
|
6
|
+
|
7
|
+
* Fix `validate_uniqueness_of.scoped_to` issue when the scoped field is already
|
8
|
+
taken (#207).
|
9
|
+
|
10
|
+
* Add comparison submatchers to `validate_numericality_of` to correspond to the
|
11
|
+
comparison options you can give to `validates_numericality_of` (#244).
|
12
|
+
|
3
13
|
# v 2.1.0
|
4
14
|
|
5
15
|
* Add missing `failure_message_for_should_not` implementations to
|
data/gemfiles/3.0.gemfile.lock
CHANGED
data/gemfiles/3.1.gemfile.lock
CHANGED
data/gemfiles/3.2.gemfile.lock
CHANGED
@@ -6,6 +6,7 @@ require 'shoulda/matchers/active_model/allow_value_matcher'
|
|
6
6
|
require 'shoulda/matchers/active_model/disallow_value_matcher'
|
7
7
|
require 'shoulda/matchers/active_model/only_integer_matcher'
|
8
8
|
require 'shoulda/matchers/active_model/odd_even_number_matcher'
|
9
|
+
require 'shoulda/matchers/active_model/comparison_matcher'
|
9
10
|
require 'shoulda/matchers/active_model/ensure_length_of_matcher'
|
10
11
|
require 'shoulda/matchers/active_model/ensure_inclusion_of_matcher'
|
11
12
|
require 'shoulda/matchers/active_model/ensure_exclusion_of_matcher'
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Shoulda # :nodoc:
|
2
|
+
module Matchers
|
3
|
+
module ActiveModel # :nodoc:
|
4
|
+
# Examples:
|
5
|
+
# it { should validate_numericality_of(:attr).
|
6
|
+
# is_greater_than(6).
|
7
|
+
# less_than(20)...(and so on) }
|
8
|
+
class ComparisonMatcher < ValidationMatcher
|
9
|
+
def initialize(value, operator)
|
10
|
+
@value = value
|
11
|
+
@operator = operator
|
12
|
+
end
|
13
|
+
|
14
|
+
def for(attribute)
|
15
|
+
@attribute = attribute
|
16
|
+
self
|
17
|
+
end
|
18
|
+
|
19
|
+
def matches?(subject)
|
20
|
+
@subject = subject
|
21
|
+
disallows_value_of(value_to_compare)
|
22
|
+
end
|
23
|
+
|
24
|
+
def allowed_types
|
25
|
+
'integer'
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def value_to_compare
|
31
|
+
case @operator
|
32
|
+
when :> then [@value, @value - 1].sample
|
33
|
+
when :>= then @value - 1
|
34
|
+
when :== then @value
|
35
|
+
when :< then [@value, @value + 1].sample
|
36
|
+
when :<= then @value + 1
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def expectation
|
41
|
+
case @operator
|
42
|
+
when :> then "greater than"
|
43
|
+
when :>= then "greater than or equal to"
|
44
|
+
when :== then "equal to"
|
45
|
+
when :< then "less than"
|
46
|
+
when :<= then "less than or equal to"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -32,8 +32,32 @@ module Shoulda # :nodoc:
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def only_integer
|
35
|
-
|
36
|
-
|
35
|
+
add_submatcher(OnlyIntegerMatcher.new(@attribute))
|
36
|
+
self
|
37
|
+
end
|
38
|
+
|
39
|
+
def is_greater_than(value)
|
40
|
+
add_submatcher(ComparisonMatcher.new(value, :>).for(@attribute))
|
41
|
+
self
|
42
|
+
end
|
43
|
+
|
44
|
+
def is_greater_than_or_equal_to(value)
|
45
|
+
add_submatcher(ComparisonMatcher.new(value, :>=).for(@attribute))
|
46
|
+
self
|
47
|
+
end
|
48
|
+
|
49
|
+
def is_equal_to(value)
|
50
|
+
add_submatcher(ComparisonMatcher.new(value, :==).for(@attribute))
|
51
|
+
self
|
52
|
+
end
|
53
|
+
|
54
|
+
def is_less_than(value)
|
55
|
+
add_submatcher(ComparisonMatcher.new(value, :<).for(@attribute))
|
56
|
+
self
|
57
|
+
end
|
58
|
+
|
59
|
+
def is_less_than_or_equal_to(value)
|
60
|
+
add_submatcher(ComparisonMatcher.new(value, :<=).for(@attribute))
|
37
61
|
self
|
38
62
|
end
|
39
63
|
|
@@ -98,7 +122,7 @@ module Shoulda # :nodoc:
|
|
98
122
|
end
|
99
123
|
|
100
124
|
def failing_submatchers
|
101
|
-
@failing_submatchers ||= @submatchers.select { |matcher| !matcher.matches?(@subject) }
|
125
|
+
@failing_submatchers ||= @submatchers.select { |matcher| !matcher.matches?(@subject.dup) }
|
102
126
|
end
|
103
127
|
|
104
128
|
def allowed_types
|
@@ -156,15 +156,13 @@ module Shoulda # :nodoc:
|
|
156
156
|
@existing_record = create_record_in_database
|
157
157
|
end
|
158
158
|
|
159
|
-
# TODO: There is a chance that we could change the scoped field
|
160
|
-
# to a value that's already taken. An alternative implementation
|
161
|
-
# could actually find all values for scope and create a unique
|
162
159
|
def validate_after_scope_change?
|
163
160
|
if @options[:scopes].blank?
|
164
161
|
true
|
165
162
|
else
|
163
|
+
all_records = @subject.class.all
|
166
164
|
@options[:scopes].all? do |scope|
|
167
|
-
previous_value =
|
165
|
+
previous_value = all_records.map(&scope).max
|
168
166
|
|
169
167
|
# Assume the scope is a foreign key if the field is nil
|
170
168
|
previous_value ||= correct_type_for_column(@subject.class.columns_hash[scope.to_s])
|
@@ -34,10 +34,10 @@ module Shoulda # :nodoc:
|
|
34
34
|
allow = allow_value_matcher(value, message)
|
35
35
|
|
36
36
|
if allow.matches?(@subject)
|
37
|
-
@failure_message_for_should_not = allow.
|
37
|
+
@failure_message_for_should_not = allow.failure_message_for_should_not
|
38
38
|
true
|
39
39
|
else
|
40
|
-
@failure_message_for_should = allow.
|
40
|
+
@failure_message_for_should = allow.failure_message_for_should
|
41
41
|
false
|
42
42
|
end
|
43
43
|
end
|
@@ -46,10 +46,10 @@ module Shoulda # :nodoc:
|
|
46
46
|
disallow = disallow_value_matcher(value, message)
|
47
47
|
|
48
48
|
if disallow.matches?(@subject)
|
49
|
-
@failure_message_for_should_not = disallow.
|
49
|
+
@failure_message_for_should_not = disallow.failure_message_for_should_not
|
50
50
|
true
|
51
51
|
else
|
52
|
-
@failure_message_for_should = disallow.
|
52
|
+
@failure_message_for_should = disallow.failure_message_for_should
|
53
53
|
false
|
54
54
|
end
|
55
55
|
end
|
@@ -309,7 +309,11 @@ module Shoulda # :nodoc:
|
|
309
309
|
end
|
310
310
|
|
311
311
|
def join_table
|
312
|
-
reflection.
|
312
|
+
if reflection.respond_to? :join_table
|
313
|
+
reflection.join_table.to_s
|
314
|
+
else
|
315
|
+
reflection.options[:join_table].to_s
|
316
|
+
end
|
313
317
|
end
|
314
318
|
|
315
319
|
def associated_class
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Shoulda::Matchers::ActiveModel::ComparisonMatcher do
|
4
|
+
context 'is_greater_than' do
|
5
|
+
it { instance_with_validations(:greater_than => 2).should matcher.is_greater_than(2) }
|
6
|
+
it { instance_without_validations.should_not matcher.is_greater_than(2) }
|
7
|
+
end
|
8
|
+
|
9
|
+
context 'greater_than_or_equal_to' do
|
10
|
+
it { instance_with_validations(:greater_than_or_equal_to => 2).should matcher.is_greater_than_or_equal_to(2) }
|
11
|
+
it { instance_without_validations.should_not matcher.is_greater_than_or_equal_to(2) }
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'less_than' do
|
15
|
+
it { instance_with_validations(:less_than => 2).should matcher.is_less_than(2) }
|
16
|
+
it { instance_without_validations.should_not matcher.is_less_than(2) }
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'less_than_or_equal_to' do
|
20
|
+
it { instance_with_validations(:less_than_or_equal_to => 2).should matcher.is_less_than_or_equal_to(2) }
|
21
|
+
it { instance_without_validations.should_not matcher.is_less_than_or_equal_to(2) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def instance_with_validations(options = {})
|
25
|
+
define_model :example, :attr => :string do
|
26
|
+
validates_numericality_of :attr, options
|
27
|
+
attr_accessible :attr
|
28
|
+
end.new
|
29
|
+
end
|
30
|
+
|
31
|
+
def instance_without_validations
|
32
|
+
define_model :example, :attr => :string do
|
33
|
+
attr_accessible :attr
|
34
|
+
end.new
|
35
|
+
end
|
36
|
+
|
37
|
+
def matcher
|
38
|
+
validate_numericality_of(:attr)
|
39
|
+
end
|
40
|
+
end
|
@@ -29,8 +29,13 @@ describe Shoulda::Matchers::ActiveModel::ValidatePresenceOfMatcher do
|
|
29
29
|
|
30
30
|
context 'an ActiveModel class without a presence validation' do
|
31
31
|
it 'rejects' do
|
32
|
-
|
33
|
-
|
32
|
+
active_model.should_not matcher
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'provides the correct failure message' do
|
36
|
+
message = %{Expected errors to include "can't be blank" when attr is set to nil, got no errors}
|
37
|
+
|
38
|
+
expect { active_model.should matcher }.to fail_with_message(message)
|
34
39
|
end
|
35
40
|
end
|
36
41
|
|
@@ -125,10 +130,12 @@ describe Shoulda::Matchers::ActiveModel::ValidatePresenceOfMatcher do
|
|
125
130
|
end.new
|
126
131
|
end
|
127
132
|
|
133
|
+
def active_model(&block)
|
134
|
+
define_active_model_class('Example', :accessors => [:attr], &block).new
|
135
|
+
end
|
136
|
+
|
128
137
|
def active_model_validating_presence
|
129
|
-
|
130
|
-
validates_presence_of :attr
|
131
|
-
end.new
|
138
|
+
active_model { validates_presence_of :attr }
|
132
139
|
end
|
133
140
|
|
134
141
|
def has_many_children(options = {})
|
@@ -118,6 +118,13 @@ describe Shoulda::Matchers::ActiveModel::ValidateUniquenessOfMatcher do
|
|
118
118
|
should matcher.scoped_to(:scope1)
|
119
119
|
end
|
120
120
|
|
121
|
+
context 'with an existing record that conflicts with scope.next' do
|
122
|
+
it 'accepts' do
|
123
|
+
validating_scoped_uniqueness_with_conflicting_next(:scope1, :date, :scope1 => Date.today).
|
124
|
+
should matcher.scoped_to(:scope1)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
121
128
|
context 'when too narrow of a scope is specified' do
|
122
129
|
it 'rejects' do
|
123
130
|
validating_scoped_uniqueness([:scope1, :scope2], :date, :scope1 => Date.today, :scope2 => Date.today).
|
@@ -132,6 +139,13 @@ describe Shoulda::Matchers::ActiveModel::ValidateUniquenessOfMatcher do
|
|
132
139
|
should matcher.scoped_to(:scope1)
|
133
140
|
end
|
134
141
|
|
142
|
+
context 'with an existing record that conflicts with scope.next' do
|
143
|
+
it 'accepts' do
|
144
|
+
validating_scoped_uniqueness_with_conflicting_next(:scope1, :datetime, :scope1 => DateTime.now).
|
145
|
+
should matcher.scoped_to(:scope1)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
135
149
|
context 'with a nil value' do
|
136
150
|
it 'accepts' do
|
137
151
|
validating_scoped_uniqueness([:scope1], :datetime, :scope1 => nil).
|
@@ -145,11 +159,22 @@ describe Shoulda::Matchers::ActiveModel::ValidateUniquenessOfMatcher do
|
|
145
159
|
should_not matcher.scoped_to(:scope1, :scope2, :other)
|
146
160
|
end
|
147
161
|
end
|
162
|
+
|
163
|
+
context 'with an existing record that conflicts with scope.next' do
|
164
|
+
it 'accepts' do
|
165
|
+
validating_scoped_uniqueness_with_conflicting_next(:scope1, :scope1 => 1).
|
166
|
+
should matcher.scoped_to(:scope1)
|
167
|
+
end
|
168
|
+
end
|
148
169
|
end
|
149
170
|
|
150
171
|
def create_existing_record(attributes = {})
|
172
|
+
@existing ||= create_record(attributes)
|
173
|
+
end
|
174
|
+
|
175
|
+
def create_record(attributes = {})
|
151
176
|
default_attributes = {:attr => 'value', :scope1 => 1, :scope2 => 2, :other => 3}
|
152
|
-
|
177
|
+
Example.create!(default_attributes.merge(attributes))
|
153
178
|
end
|
154
179
|
|
155
180
|
def define_scoped_model(scope, scope_attr_type = :integer)
|
@@ -166,6 +191,16 @@ describe Shoulda::Matchers::ActiveModel::ValidateUniquenessOfMatcher do
|
|
166
191
|
create_existing_record(attributes)
|
167
192
|
model
|
168
193
|
end
|
194
|
+
|
195
|
+
def validating_scoped_uniqueness_with_conflicting_next(*args)
|
196
|
+
attributes = args.extract_options!
|
197
|
+
model = define_scoped_model(*args).new
|
198
|
+
2.times do
|
199
|
+
attributes[:scope1] = attributes[:scope1].next
|
200
|
+
create_record(attributes)
|
201
|
+
end
|
202
|
+
model
|
203
|
+
end
|
169
204
|
end
|
170
205
|
|
171
206
|
context 'a model with a case-sensitive uniqueness validation on a string attribute and an existing record' do
|
@@ -0,0 +1,32 @@
|
|
1
|
+
RSpec::Matchers.define :fail_with_message do |expected|
|
2
|
+
match do |block|
|
3
|
+
@actual = nil
|
4
|
+
|
5
|
+
begin
|
6
|
+
block.call
|
7
|
+
rescue RSpec::Expectations::ExpectationNotMetError => ex
|
8
|
+
@actual = ex.message
|
9
|
+
end
|
10
|
+
|
11
|
+
@actual && @actual == expected
|
12
|
+
end
|
13
|
+
|
14
|
+
failure_message_for_should do
|
15
|
+
msg = "Expectation should have failed with message '#{expected}'"
|
16
|
+
|
17
|
+
if @actual
|
18
|
+
msg << ", actually failed with '#{@actual}'"
|
19
|
+
else
|
20
|
+
msg << ", but did not fail."
|
21
|
+
end
|
22
|
+
|
23
|
+
msg
|
24
|
+
end
|
25
|
+
|
26
|
+
failure_message_for_should_not do
|
27
|
+
msg = "Expectation should not have failed with message '#{expected}'"
|
28
|
+
msg << ", but did."
|
29
|
+
|
30
|
+
msg
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoulda-matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Tammer Saleh
|
@@ -13,11 +14,12 @@ authors:
|
|
13
14
|
autorequire:
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
|
-
date: 2013-
|
17
|
+
date: 2013-06-11 00:00:00.000000000 Z
|
17
18
|
dependencies:
|
18
19
|
- !ruby/object:Gem::Dependency
|
19
20
|
name: activesupport
|
20
21
|
requirement: !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
21
23
|
requirements:
|
22
24
|
- - ! '>='
|
23
25
|
- !ruby/object:Gem::Version
|
@@ -25,6 +27,7 @@ dependencies:
|
|
25
27
|
type: :runtime
|
26
28
|
prerelease: false
|
27
29
|
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
28
31
|
requirements:
|
29
32
|
- - ! '>='
|
30
33
|
- !ruby/object:Gem::Version
|
@@ -32,6 +35,7 @@ dependencies:
|
|
32
35
|
- !ruby/object:Gem::Dependency
|
33
36
|
name: appraisal
|
34
37
|
requirement: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
35
39
|
requirements:
|
36
40
|
- - ~>
|
37
41
|
- !ruby/object:Gem::Version
|
@@ -39,6 +43,7 @@ dependencies:
|
|
39
43
|
type: :development
|
40
44
|
prerelease: false
|
41
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
42
47
|
requirements:
|
43
48
|
- - ~>
|
44
49
|
- !ruby/object:Gem::Version
|
@@ -46,6 +51,7 @@ dependencies:
|
|
46
51
|
- !ruby/object:Gem::Dependency
|
47
52
|
name: aruba
|
48
53
|
requirement: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
49
55
|
requirements:
|
50
56
|
- - ! '>='
|
51
57
|
- !ruby/object:Gem::Version
|
@@ -53,6 +59,7 @@ dependencies:
|
|
53
59
|
type: :development
|
54
60
|
prerelease: false
|
55
61
|
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
56
63
|
requirements:
|
57
64
|
- - ! '>='
|
58
65
|
- !ruby/object:Gem::Version
|
@@ -60,6 +67,7 @@ dependencies:
|
|
60
67
|
- !ruby/object:Gem::Dependency
|
61
68
|
name: bourne
|
62
69
|
requirement: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
63
71
|
requirements:
|
64
72
|
- - ~>
|
65
73
|
- !ruby/object:Gem::Version
|
@@ -67,6 +75,7 @@ dependencies:
|
|
67
75
|
type: :development
|
68
76
|
prerelease: false
|
69
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
70
79
|
requirements:
|
71
80
|
- - ~>
|
72
81
|
- !ruby/object:Gem::Version
|
@@ -74,6 +83,7 @@ dependencies:
|
|
74
83
|
- !ruby/object:Gem::Dependency
|
75
84
|
name: bundler
|
76
85
|
requirement: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
77
87
|
requirements:
|
78
88
|
- - ~>
|
79
89
|
- !ruby/object:Gem::Version
|
@@ -81,6 +91,7 @@ dependencies:
|
|
81
91
|
type: :development
|
82
92
|
prerelease: false
|
83
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
84
95
|
requirements:
|
85
96
|
- - ~>
|
86
97
|
- !ruby/object:Gem::Version
|
@@ -88,6 +99,7 @@ dependencies:
|
|
88
99
|
- !ruby/object:Gem::Dependency
|
89
100
|
name: cucumber
|
90
101
|
requirement: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
91
103
|
requirements:
|
92
104
|
- - ~>
|
93
105
|
- !ruby/object:Gem::Version
|
@@ -95,6 +107,7 @@ dependencies:
|
|
95
107
|
type: :development
|
96
108
|
prerelease: false
|
97
109
|
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
98
111
|
requirements:
|
99
112
|
- - ~>
|
100
113
|
- !ruby/object:Gem::Version
|
@@ -102,6 +115,7 @@ dependencies:
|
|
102
115
|
- !ruby/object:Gem::Dependency
|
103
116
|
name: rails
|
104
117
|
requirement: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
105
119
|
requirements:
|
106
120
|
- - ~>
|
107
121
|
- !ruby/object:Gem::Version
|
@@ -109,6 +123,7 @@ dependencies:
|
|
109
123
|
type: :development
|
110
124
|
prerelease: false
|
111
125
|
version_requirements: !ruby/object:Gem::Requirement
|
126
|
+
none: false
|
112
127
|
requirements:
|
113
128
|
- - ~>
|
114
129
|
- !ruby/object:Gem::Version
|
@@ -116,6 +131,7 @@ dependencies:
|
|
116
131
|
- !ruby/object:Gem::Dependency
|
117
132
|
name: rake
|
118
133
|
requirement: !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
119
135
|
requirements:
|
120
136
|
- - ! '>='
|
121
137
|
- !ruby/object:Gem::Version
|
@@ -123,6 +139,7 @@ dependencies:
|
|
123
139
|
type: :development
|
124
140
|
prerelease: false
|
125
141
|
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
none: false
|
126
143
|
requirements:
|
127
144
|
- - ! '>='
|
128
145
|
- !ruby/object:Gem::Version
|
@@ -130,6 +147,7 @@ dependencies:
|
|
130
147
|
- !ruby/object:Gem::Dependency
|
131
148
|
name: rspec-rails
|
132
149
|
requirement: !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
133
151
|
requirements:
|
134
152
|
- - ~>
|
135
153
|
- !ruby/object:Gem::Version
|
@@ -137,6 +155,7 @@ dependencies:
|
|
137
155
|
type: :development
|
138
156
|
prerelease: false
|
139
157
|
version_requirements: !ruby/object:Gem::Requirement
|
158
|
+
none: false
|
140
159
|
requirements:
|
141
160
|
- - ~>
|
142
161
|
- !ruby/object:Gem::Version
|
@@ -144,6 +163,7 @@ dependencies:
|
|
144
163
|
- !ruby/object:Gem::Dependency
|
145
164
|
name: strong_parameters
|
146
165
|
requirement: !ruby/object:Gem::Requirement
|
166
|
+
none: false
|
147
167
|
requirements:
|
148
168
|
- - ! '>='
|
149
169
|
- !ruby/object:Gem::Version
|
@@ -151,6 +171,7 @@ dependencies:
|
|
151
171
|
type: :development
|
152
172
|
prerelease: false
|
153
173
|
version_requirements: !ruby/object:Gem::Requirement
|
174
|
+
none: false
|
154
175
|
requirements:
|
155
176
|
- - ! '>='
|
156
177
|
- !ruby/object:Gem::Version
|
@@ -194,6 +215,7 @@ files:
|
|
194
215
|
- lib/shoulda/matchers/active_model.rb
|
195
216
|
- lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb
|
196
217
|
- lib/shoulda/matchers/active_model/allow_value_matcher.rb
|
218
|
+
- lib/shoulda/matchers/active_model/comparison_matcher.rb
|
197
219
|
- lib/shoulda/matchers/active_model/disallow_value_matcher.rb
|
198
220
|
- lib/shoulda/matchers/active_model/ensure_exclusion_of_matcher.rb
|
199
221
|
- lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb
|
@@ -233,6 +255,7 @@ files:
|
|
233
255
|
- spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb
|
234
256
|
- spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb
|
235
257
|
- spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb
|
258
|
+
- spec/shoulda/matchers/active_model/comparison_matcher_spec.rb
|
236
259
|
- spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb
|
237
260
|
- spec/shoulda/matchers/active_model/ensure_exclusion_of_matcher_spec.rb
|
238
261
|
- spec/shoulda/matchers/active_model/ensure_inclusion_of_matcher_spec.rb
|
@@ -258,32 +281,37 @@ files:
|
|
258
281
|
- spec/support/activemodel_helpers.rb
|
259
282
|
- spec/support/class_builder.rb
|
260
283
|
- spec/support/controller_builder.rb
|
284
|
+
- spec/support/fail_with_message_matcher.rb
|
261
285
|
- spec/support/i18n_faker.rb
|
262
286
|
- spec/support/mailer_builder.rb
|
263
287
|
- spec/support/model_builder.rb
|
264
288
|
homepage: http://thoughtbot.com/community/
|
265
289
|
licenses:
|
266
290
|
- MIT
|
267
|
-
metadata: {}
|
268
291
|
post_install_message:
|
269
292
|
rdoc_options: []
|
270
293
|
require_paths:
|
271
294
|
- lib
|
272
295
|
required_ruby_version: !ruby/object:Gem::Requirement
|
296
|
+
none: false
|
273
297
|
requirements:
|
274
298
|
- - ! '>='
|
275
299
|
- !ruby/object:Gem::Version
|
276
300
|
version: 1.9.2
|
277
301
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
302
|
+
none: false
|
278
303
|
requirements:
|
279
304
|
- - ! '>='
|
280
305
|
- !ruby/object:Gem::Version
|
281
306
|
version: '0'
|
307
|
+
segments:
|
308
|
+
- 0
|
309
|
+
hash: -819827211326946957
|
282
310
|
requirements: []
|
283
311
|
rubyforge_project:
|
284
|
-
rubygems_version:
|
312
|
+
rubygems_version: 1.8.23
|
285
313
|
signing_key:
|
286
|
-
specification_version:
|
314
|
+
specification_version: 3
|
287
315
|
summary: Making tests easy on the fingers and eyes
|
288
316
|
test_files:
|
289
317
|
- features/rails_integration.feature
|
@@ -300,6 +328,7 @@ test_files:
|
|
300
328
|
- spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb
|
301
329
|
- spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb
|
302
330
|
- spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb
|
331
|
+
- spec/shoulda/matchers/active_model/comparison_matcher_spec.rb
|
303
332
|
- spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb
|
304
333
|
- spec/shoulda/matchers/active_model/ensure_exclusion_of_matcher_spec.rb
|
305
334
|
- spec/shoulda/matchers/active_model/ensure_inclusion_of_matcher_spec.rb
|
@@ -325,6 +354,7 @@ test_files:
|
|
325
354
|
- spec/support/activemodel_helpers.rb
|
326
355
|
- spec/support/class_builder.rb
|
327
356
|
- spec/support/controller_builder.rb
|
357
|
+
- spec/support/fail_with_message_matcher.rb
|
328
358
|
- spec/support/i18n_faker.rb
|
329
359
|
- spec/support/mailer_builder.rb
|
330
360
|
- spec/support/model_builder.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
YzVkMDJkYmRiNjE2ODM0MDMzMzQxODQwZTBjMWEzM2RmYTMyZTIzYQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NTExOTlmMTUyOGU1NjVlZjM0YzVhN2FiNDVjYTE3NmI0ZDU0ZjNiMQ==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NWI5ZTA2ZGJjMTJmNjgxYjI0Mjk1NGZhYjZkYzUyMmIwNjJjZmJhYjRjZGRh
|
10
|
-
NTA2MjIwZDMzZjQ3YmIxMTNjNGUwMjEzYzg1ZjkzZDA2ZThlY2UyZWY5OGNm
|
11
|
-
OTY0ZTg4ZjM2ODQxZTU0OTg4MDhmMTA0ZDU3YjEyNTcxZmVlNDQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
N2FkMWNjZTgzOTgwZjcwOWE2YjE2NzU1ZDNmMDQwZDEzNjQzMjVhMTAxYjQy
|
14
|
-
NjJjYmI0NmFlN2E3OTZkOGU0ODIzNDllMDgwZjlhNjRmNTRmMWQ3YWU5ZGNk
|
15
|
-
NzA0NmE5MzVkM2JhODAzNjMyNDU3NzBlYzIyZWUwYmRiNzEwMjI=
|