remockable 0.0.12 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/lib/remockable/active_model/allow_mass_assignment_of.rb +7 -6
- data/lib/remockable/active_model/allow_values_for.rb +3 -3
- data/lib/remockable/active_model/helpers.rb +19 -2
- data/lib/remockable/active_model/validate_acceptance_of.rb +7 -9
- data/lib/remockable/active_model/validate_confirmation_of.rb +7 -9
- data/lib/remockable/active_model/validate_exclusion_of.rb +7 -9
- data/lib/remockable/active_model/validate_format_of.rb +7 -9
- data/lib/remockable/active_model/validate_inclusion_of.rb +7 -9
- data/lib/remockable/active_model/validate_length_of.rb +12 -11
- data/lib/remockable/active_model/validate_numericality_of.rb +8 -9
- data/lib/remockable/active_model/validate_presence_of.rb +7 -9
- data/lib/remockable/active_record/accept_nested_attributes_for.rb +3 -3
- data/lib/remockable/active_record/belong_to.rb +6 -4
- data/lib/remockable/active_record/have_and_belong_to_many.rb +6 -4
- data/lib/remockable/active_record/have_column.rb +3 -3
- data/lib/remockable/active_record/have_index.rb +3 -3
- data/lib/remockable/active_record/have_many.rb +3 -3
- data/lib/remockable/active_record/have_one.rb +3 -3
- data/lib/remockable/active_record/have_scope.rb +3 -3
- data/lib/remockable/active_record/validate_associated.rb +7 -9
- data/lib/remockable/active_record/validate_uniqueness_of.rb +7 -9
- data/lib/remockable/version.rb +1 -1
- metadata +16 -16
data/README.markdown
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
RSpec::Matchers.define(:allow_mass_assignment_of) do |*
|
2
|
-
@options =
|
1
|
+
RSpec::Matchers.define(:allow_mass_assignment_of) do |*attribute|
|
2
|
+
@options = attribute.extract_options!
|
3
|
+
@attribute = attribute.shift
|
4
|
+
|
3
5
|
@role = @options[:as] || :default
|
4
|
-
@attributes = attributes
|
5
6
|
@authorizer = nil
|
6
7
|
|
7
8
|
def authorizer(actual)
|
@@ -11,11 +12,11 @@ RSpec::Matchers.define(:allow_mass_assignment_of) do |*attributes|
|
|
11
12
|
end
|
12
13
|
|
13
14
|
match_for_should do |actual|
|
14
|
-
|
15
|
+
!authorizer(actual).deny?(@attribute)
|
15
16
|
end
|
16
17
|
|
17
18
|
match_for_should_not do |actual|
|
18
|
-
|
19
|
+
authorizer(actual).deny?(@attribute)
|
19
20
|
end
|
20
21
|
|
21
22
|
failure_message_for_should do |actual|
|
@@ -27,6 +28,6 @@ RSpec::Matchers.define(:allow_mass_assignment_of) do |*attributes|
|
|
27
28
|
end
|
28
29
|
|
29
30
|
description do
|
30
|
-
"allow mass-assignment of #{@
|
31
|
+
"allow mass-assignment of #{@attribute}"
|
31
32
|
end
|
32
33
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
RSpec::Matchers.define(:allow_values_for) do |*
|
2
|
-
@attribute =
|
3
|
-
@values =
|
1
|
+
RSpec::Matchers.define(:allow_values_for) do |*attribute_and_values|
|
2
|
+
@attribute = attribute_and_values.shift
|
3
|
+
@values = attribute_and_values
|
4
4
|
|
5
5
|
match_for_should do |actual|
|
6
6
|
@values.all? do |value|
|
@@ -3,6 +3,8 @@ module Remockable
|
|
3
3
|
module Helpers
|
4
4
|
include Remockable::Helpers
|
5
5
|
|
6
|
+
CONDITIONALS = [:if, :unless]
|
7
|
+
|
6
8
|
attr_reader :type
|
7
9
|
|
8
10
|
def validator_for(attribute)
|
@@ -11,8 +13,23 @@ module Remockable
|
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
15
|
-
|
16
|
+
def options_match(validator, expected=expected)
|
17
|
+
actual = validator.options.slice(*(expected.keys - CONDITIONALS))
|
18
|
+
actual == expected.except(*CONDITIONALS)
|
19
|
+
end
|
20
|
+
|
21
|
+
def conditionals_match(validator)
|
22
|
+
CONDITIONALS.all? do |option|
|
23
|
+
expected_value = expected[option]
|
24
|
+
|
25
|
+
if !expected_value.nil? && expected_value.is_a?(Symbol)
|
26
|
+
validator.options[option] == expected_value
|
27
|
+
elsif !expected_value.nil?
|
28
|
+
validator.options[option].call(expected_value) == true
|
29
|
+
else
|
30
|
+
true
|
31
|
+
end
|
32
|
+
end
|
16
33
|
end
|
17
34
|
end
|
18
35
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_acceptance_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_acceptance_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :acceptance
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(allow_nil accept message on)
|
8
|
+
valid_options %w(allow_nil accept if message on unless)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_acceptance_of) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
25
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_confirmation_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_confirmation_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :confirmation
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(message on)
|
8
|
+
valid_options %w(if message on unless)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_confirmation_of) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
25
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_exclusion_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_exclusion_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :exclusion
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(allow_nil allow_blank in message on)
|
8
|
+
valid_options %w(allow_nil allow_blank if in message on unless)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_exclusion_of) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
25
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_format_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_format_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :format
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(allow_blank allow_nil message on with without)
|
8
|
+
valid_options %w(allow_blank allow_nil if message on unless with without)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_format_of) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
25
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_inclusion_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_inclusion_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :inclusion
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(allow_nil allow_blank in message on)
|
8
|
+
valid_options %w(allow_nil allow_blank if in message on unless)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_inclusion_of) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
25
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
@@ -1,22 +1,23 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_length_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_length_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :length
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
unsupported_options %w(
|
9
|
-
valid_options %w(allow_blank allow_nil in is maximum message minimum on
|
10
|
-
too_long too_short within wrong_length)
|
8
|
+
unsupported_options %w(tokenizer)
|
9
|
+
valid_options %w(allow_blank allow_nil if in is maximum message minimum on
|
10
|
+
too_long too_short unless within wrong_length)
|
11
11
|
|
12
12
|
match do |actual|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
if validator = validator_for(@attribute)
|
14
|
+
options_match = options_match(validator, normalized_expected)
|
15
|
+
conditionals_match = conditionals_match(validator)
|
16
|
+
options_match && conditionals_match
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
19
|
-
def
|
20
|
+
def normalized_expected
|
20
21
|
expected.dup.tap do |expected|
|
21
22
|
if within = expected.delete(:within) || expected.delete(:in)
|
22
23
|
expected[:minimum] = within.first
|
@@ -35,6 +36,6 @@ RSpec::Matchers.define(:validate_length_of) do |*attributes|
|
|
35
36
|
|
36
37
|
description do
|
37
38
|
with = " with #{expected.inspect}" if expected.any?
|
38
|
-
"validate #{type} of #{@
|
39
|
+
"validate #{type} of #{@attribute}#{with}"
|
39
40
|
end
|
40
41
|
end
|
@@ -1,17 +1,16 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_numericality_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_numericality_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :numericality
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
valid_options %w(allow_nil equal_to even greater_than greater_than_or_equal_to
|
9
|
+
if less_than less_than_or_equal_to message odd on only_integer unless)
|
10
10
|
|
11
11
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
12
|
+
validator = validator_for(@attribute)
|
13
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
14
|
end
|
16
15
|
|
17
16
|
failure_message_for_should do |actual|
|
@@ -24,6 +23,6 @@ RSpec::Matchers.define(:validate_numericality_of) do |*attributes|
|
|
24
23
|
|
25
24
|
description do
|
26
25
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
26
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
27
|
end
|
29
28
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_presence_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_presence_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :presence
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(message on)
|
8
|
+
valid_options %w(if message on unless)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_presence_of) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
25
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
RSpec::Matchers.define(:accept_nested_attributes_for) do |*
|
1
|
+
RSpec::Matchers.define(:accept_nested_attributes_for) do |*association|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@association =
|
4
|
+
@expected = association.extract_options!
|
5
|
+
@association = association.shift
|
6
6
|
|
7
7
|
unsupported_options %w(reject_if)
|
8
8
|
valid_options %w(allow_destroy limit update_only)
|
@@ -1,11 +1,13 @@
|
|
1
|
-
RSpec::Matchers.define(:belong_to) do |*
|
1
|
+
RSpec::Matchers.define(:belong_to) do |*association|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@association =
|
4
|
+
@expected = association.extract_options!
|
5
|
+
@association = association.shift
|
6
6
|
|
7
7
|
unsupported_options %w(extend)
|
8
|
-
valid_options %w(class_name conditions select foreign_key primary_key
|
8
|
+
valid_options %w(class_name conditions select foreign_key primary_key
|
9
|
+
dependent counter_cache include polymorphic readonly validate autosave touch
|
10
|
+
inverse_of)
|
9
11
|
|
10
12
|
match do |actual|
|
11
13
|
if association = subject.class.reflect_on_association(@association)
|
@@ -1,11 +1,13 @@
|
|
1
|
-
RSpec::Matchers.define(:have_and_belong_to_many) do |*
|
1
|
+
RSpec::Matchers.define(:have_and_belong_to_many) do |*association|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@association =
|
4
|
+
@expected = association.extract_options!
|
5
|
+
@association = association.shift
|
6
6
|
|
7
7
|
unsupported_options %w(extend)
|
8
|
-
valid_options %w(class_name join_table foreign_key association_foreign_key
|
8
|
+
valid_options %w(class_name join_table foreign_key association_foreign_key
|
9
|
+
conditions order uniq finder_sql counter_sql delete_sql insert_sql include
|
10
|
+
group having limit offset select readonly validate autosave)
|
9
11
|
|
10
12
|
match do |actual|
|
11
13
|
if association = subject.class.reflect_on_association(@association)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
RSpec::Matchers.define(:have_column) do |*
|
1
|
+
RSpec::Matchers.define(:have_column) do |*column|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@column =
|
4
|
+
@expected = column.extract_options!
|
5
|
+
@column = column.shift
|
6
6
|
|
7
7
|
valid_options %w(default limit null precision scale type)
|
8
8
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
RSpec::Matchers.define(:have_index) do |*
|
1
|
+
RSpec::Matchers.define(:have_index) do |*columns|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@columns =
|
4
|
+
@expected = columns.extract_options!
|
5
|
+
@columns = columns
|
6
6
|
|
7
7
|
valid_options %w(name unique)
|
8
8
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
RSpec::Matchers.define(:have_many) do |*
|
1
|
+
RSpec::Matchers.define(:have_many) do |*association|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@association =
|
4
|
+
@expected = association.extract_options!
|
5
|
+
@association = association.shift
|
6
6
|
|
7
7
|
unsupported_options %w(extend)
|
8
8
|
valid_options %w(class_name conditions order foreign_key primary_key dependent finder_sql counter_sql include group having limit offset select as through source source_type uniq readonly validate autosave inverse_of)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
RSpec::Matchers.define(:have_one) do |*
|
1
|
+
RSpec::Matchers.define(:have_one) do |*association|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@association =
|
4
|
+
@expected = association.extract_options!
|
5
|
+
@association = association.shift
|
6
6
|
|
7
7
|
unsupported_options %w(extend)
|
8
8
|
valid_options %w(class_name conditions order dependent foreign_key primary_key include as select through source source_type readonly validate autosave inverse_of)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
RSpec::Matchers.define(:have_scope) do |*
|
1
|
+
RSpec::Matchers.define(:have_scope) do |*name|
|
2
2
|
extend Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
@expected =
|
5
|
-
@name =
|
4
|
+
@expected = name.extract_options!
|
5
|
+
@name = name.shift
|
6
6
|
@relation = nil
|
7
7
|
|
8
8
|
valid_options %w(with)
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_associated) do |*
|
1
|
+
RSpec::Matchers.define(:validate_associated) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :associated
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(message on)
|
8
|
+
valid_options %w(if message on unless)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_associated) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} #{@
|
25
|
+
"validate #{type} #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
RSpec::Matchers.define(:validate_uniqueness_of) do |*
|
1
|
+
RSpec::Matchers.define(:validate_uniqueness_of) do |*attribute|
|
2
2
|
extend Remockable::ActiveModel::Helpers
|
3
3
|
|
4
4
|
@type = :uniqueness
|
5
|
-
@expected =
|
6
|
-
@
|
5
|
+
@expected = attribute.extract_options!
|
6
|
+
@attribute = attribute.shift
|
7
7
|
|
8
|
-
|
9
|
-
valid_options %w(allow_nil allow_blank case_sensitive message scope)
|
8
|
+
valid_options %w(allow_nil allow_blank case_sensitive if message scope unless)
|
10
9
|
|
11
10
|
match do |actual|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
11
|
+
validator = validator_for(@attribute)
|
12
|
+
validator && options_match(validator) && conditionals_match(validator)
|
15
13
|
end
|
16
14
|
|
17
15
|
failure_message_for_should do |actual|
|
@@ -24,6 +22,6 @@ RSpec::Matchers.define(:validate_uniqueness_of) do |*attributes|
|
|
24
22
|
|
25
23
|
description do
|
26
24
|
with = " with #{expected.inspect}" if expected.any?
|
27
|
-
"validate #{type} of #{@
|
25
|
+
"validate #{type} of #{@attribute}#{with}"
|
28
26
|
end
|
29
27
|
end
|
data/lib/remockable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remockable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-02-26 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
16
|
-
requirement: &
|
16
|
+
requirement: &70234091122900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70234091122900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activerecord
|
27
|
-
requirement: &
|
27
|
+
requirement: &70234091122400 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '3.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70234091122400
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: activesupport
|
38
|
-
requirement: &
|
38
|
+
requirement: &70234091121940 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70234091121940
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec-core
|
49
|
-
requirement: &
|
49
|
+
requirement: &70234091121480 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '2.0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70234091121480
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec-expectations
|
60
|
-
requirement: &
|
60
|
+
requirement: &70234091121020 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '2.0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70234091121020
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec-mocks
|
71
|
-
requirement: &
|
71
|
+
requirement: &70234091153580 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '2.0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70234091153580
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: sqlite3
|
82
|
-
requirement: &
|
82
|
+
requirement: &70234091153120 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: 1.3.4
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70234091153120
|
91
91
|
description:
|
92
92
|
email:
|
93
93
|
executables: []
|