remockable 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/remockable/active_model/helpers.rb +1 -1
- data/lib/remockable/active_model/validate_acceptance_of.rb +1 -1
- data/lib/remockable/active_model/validate_confirmation_of.rb +1 -1
- data/lib/remockable/active_model/validate_exclusion_of.rb +1 -1
- data/lib/remockable/active_model/validate_format_of.rb +1 -1
- data/lib/remockable/active_model/validate_inclusion_of.rb +1 -1
- data/lib/remockable/active_model/validate_length_of.rb +2 -2
- data/lib/remockable/active_model/validate_numericality_of.rb +1 -1
- data/lib/remockable/active_model/validate_presence_of.rb +1 -1
- data/lib/remockable/active_record/accept_nested_attributes_for.rb +2 -2
- data/lib/remockable/active_record/belong_to.rb +1 -1
- data/lib/remockable/active_record/have_and_belong_to_many.rb +1 -1
- data/lib/remockable/active_record/have_column.rb +1 -1
- data/lib/remockable/active_record/have_default_scope.rb +4 -4
- data/lib/remockable/active_record/have_index.rb +1 -1
- data/lib/remockable/active_record/have_many.rb +1 -1
- data/lib/remockable/active_record/have_one.rb +1 -1
- data/lib/remockable/active_record/have_scope.rb +4 -4
- data/lib/remockable/active_record/validate_associated.rb +1 -1
- data/lib/remockable/active_record/validate_uniqueness_of.rb +1 -1
- data/lib/remockable/helpers.rb +2 -2
- data/lib/remockable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3199603ae0cbcc6724c562cc3cd30f765c9f91
|
4
|
+
data.tar.gz: 6f3a4fef9e85c0d7e2aafd582ddfd699c5fefeb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8b6652ff81f5252f8a74a14eb18c27470677bb76a11efc65e3a06fc60812c90cf4b71e95ef33427493905b3ad1c3c7a57219f46febb5ed5447a55893fd6a291
|
7
|
+
data.tar.gz: d9fb6e23a72385726ab12299550248506e78f24029f53b415cabf29af497d3a0c93de79f9526d2addc8ea56b1b7a9038c0f26ea26389b614a74e02ef8297115b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.3.1 (2015-10-09)
|
4
|
+
|
5
|
+
* Fix circular reference error in Ruby 2.2 ([Nathaniel Bibler][nbibler])
|
6
|
+
* Restore support for Ruby 1.9 ([Nathaniel Bibler][nbibler])
|
7
|
+
|
3
8
|
## 0.3.0 (2014-07-21)
|
4
9
|
|
5
10
|
* Support and require RSpec ~> 3.0 ([Tyler Hunt][tylerhunt])
|
@@ -91,3 +96,4 @@
|
|
91
96
|
[jswanner]: https://github.com/jswanner
|
92
97
|
[olivierlacan]: https://github.com/olivierlacan
|
93
98
|
[tylerhunt]: https://github.com/tylerhunt
|
99
|
+
[nbibler]: https://github.com/nbibler
|
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_format_of) do
|
|
3
3
|
|
4
4
|
type :format
|
5
5
|
|
6
|
-
valid_options %
|
6
|
+
valid_options %w(allow_blank allow_nil if message on unless with without)
|
7
7
|
|
8
8
|
match do |actual|
|
9
9
|
validator = validator_for(attribute)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
RSpec::Matchers.define(:accept_nested_attributes_for) do
|
2
2
|
include Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
unsupported_options %
|
5
|
-
valid_options %
|
4
|
+
unsupported_options %w(reject_if)
|
5
|
+
valid_options %w(allow_destroy limit update_only)
|
6
6
|
|
7
7
|
match do |actual|
|
8
8
|
if actual_options = subject.class.nested_attributes_options[attribute]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
RSpec::Matchers.define(:have_column) do
|
2
2
|
include Remockable::ActiveRecord::Helpers
|
3
3
|
|
4
|
-
valid_options %
|
4
|
+
valid_options %w(default limit null precision scale type)
|
5
5
|
|
6
6
|
def column
|
7
7
|
@column ||= subject.class.columns.detect { |column|
|
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:have_default_scope) do
|
|
3
3
|
|
4
4
|
attr_accessor :relation
|
5
5
|
|
6
|
-
valid_options
|
6
|
+
valid_options []
|
7
7
|
|
8
8
|
match do |actual|
|
9
9
|
if subject.class.respond_to?(:all)
|
@@ -29,7 +29,7 @@ RSpec::Matchers.define(:have_default_scope) do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def method_missing(method, *args, &block)
|
32
|
-
unsupported_query_methods = %
|
32
|
+
unsupported_query_methods = %w(
|
33
33
|
create_with
|
34
34
|
eager_load
|
35
35
|
includes
|
@@ -38,7 +38,7 @@ RSpec::Matchers.define(:have_default_scope) do
|
|
38
38
|
readonly
|
39
39
|
)
|
40
40
|
|
41
|
-
query_methods = %
|
41
|
+
query_methods = %w(
|
42
42
|
from
|
43
43
|
group
|
44
44
|
having
|
@@ -49,7 +49,7 @@ RSpec::Matchers.define(:have_default_scope) do
|
|
49
49
|
reorder
|
50
50
|
select
|
51
51
|
where
|
52
|
-
)
|
52
|
+
).collect(&:to_sym)
|
53
53
|
|
54
54
|
if query_methods.include?(method)
|
55
55
|
self.relation ||= subject.class.unscoped
|
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:have_scope) do |*name|
|
|
3
3
|
|
4
4
|
attr_accessor :relation
|
5
5
|
|
6
|
-
valid_options %
|
6
|
+
valid_options %w(with)
|
7
7
|
|
8
8
|
match do |actual|
|
9
9
|
if subject.class.respond_to?(attribute)
|
@@ -32,9 +32,9 @@ RSpec::Matchers.define(:have_scope) do |*name|
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def method_missing(method, *args, &block)
|
35
|
-
unsupported_query_methods = %(create_with)
|
35
|
+
unsupported_query_methods = %w(create_with)
|
36
36
|
|
37
|
-
query_methods = %
|
37
|
+
query_methods = %w(
|
38
38
|
eager_load
|
39
39
|
from
|
40
40
|
group
|
@@ -50,7 +50,7 @@ RSpec::Matchers.define(:have_scope) do |*name|
|
|
50
50
|
reorder
|
51
51
|
select
|
52
52
|
where
|
53
|
-
)
|
53
|
+
).collect(&:to_sym)
|
54
54
|
|
55
55
|
if query_methods.include?(method)
|
56
56
|
self.relation ||= subject.class.all
|
data/lib/remockable/helpers.rb
CHANGED
@@ -13,13 +13,13 @@ module Remockable
|
|
13
13
|
|
14
14
|
def unsupported_options(keys)
|
15
15
|
define_method :unsupported_options do
|
16
|
-
keys
|
16
|
+
keys.collect(&:to_sym)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
def valid_options(keys)
|
21
21
|
define_method :valid_options do
|
22
|
-
keys
|
22
|
+
keys.collect(&:to_sym)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/remockable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remockable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Hunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.
|
212
|
+
rubygems_version: 2.4.5
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: A collection of RSpec matchers for web apps.
|