remockable 0.3.0 → 0.3.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: ee2c0d5e24fd72b1280d3919d63e2aaf3563dc4f
4
- data.tar.gz: ca1a9717a4db8971bc24b37382751cb393929b14
3
+ metadata.gz: de3199603ae0cbcc6724c562cc3cd30f765c9f91
4
+ data.tar.gz: 6f3a4fef9e85c0d7e2aafd582ddfd699c5fefeb8
5
5
  SHA512:
6
- metadata.gz: 9c8d53e66884d01edb3ac664b804a000fabff8d5544c613709bcb484e0412517f5dde27441002e41cb0c099ab4313b23d7bbf8647c0f6caf048884af2491b4a4
7
- data.tar.gz: a0130e79de52649f5df8af42afe7020fec8b112c650fcad1962dc7d9313b95addee9d598e4037c50ffa7d4d9a0c1dc29fca5a43721d3c19025c0dfa64901c16b
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
@@ -16,7 +16,7 @@ module Remockable
16
16
  end
17
17
  end
18
18
 
19
- def options_match(validator, options=options)
19
+ def options_match(validator, options=self.options)
20
20
  actual = validator.options.slice(*(options.keys - CONDITIONALS))
21
21
  actual == options.except(*CONDITIONALS)
22
22
  end
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_acceptance_of) do
3
3
 
4
4
  type :acceptance
5
5
 
6
- valid_options %i(allow_nil accept if message on unless)
6
+ valid_options %w(allow_nil accept if message on unless)
7
7
 
8
8
  match do |actual|
9
9
  validator = validator_for(attribute)
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_confirmation_of) do
3
3
 
4
4
  type :confirmation
5
5
 
6
- valid_options %i(if message on unless)
6
+ valid_options %w(if message on unless)
7
7
 
8
8
  match do |actual|
9
9
  validator = validator_for(attribute)
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_exclusion_of) do
3
3
 
4
4
  type :exclusion
5
5
 
6
- valid_options %i(allow_nil allow_blank if in message on unless)
6
+ valid_options %w(allow_nil allow_blank if in message on unless)
7
7
 
8
8
  match do |actual|
9
9
  validator = validator_for(attribute)
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_format_of) do
3
3
 
4
4
  type :format
5
5
 
6
- valid_options %i(allow_blank allow_nil if message on unless with without)
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)
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_inclusion_of) do
3
3
 
4
4
  type :inclusion
5
5
 
6
- valid_options %i(allow_nil allow_blank if in message on unless)
6
+ valid_options %w(allow_nil allow_blank if in message on unless)
7
7
 
8
8
  match do |actual|
9
9
  validator = validator_for(attribute)
@@ -3,9 +3,9 @@ RSpec::Matchers.define(:validate_length_of) do
3
3
 
4
4
  type :length
5
5
 
6
- unsupported_options %i(tokenizer)
6
+ unsupported_options %w(tokenizer)
7
7
 
8
- valid_options %i(
8
+ valid_options %w(
9
9
  allow_blank
10
10
  allow_nil
11
11
  if
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_numericality_of) do
3
3
 
4
4
  type :numericality
5
5
 
6
- valid_options %i(
6
+ valid_options %w(
7
7
  allow_nil
8
8
  equal_to
9
9
  even
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_presence_of) do
3
3
 
4
4
  type :presence
5
5
 
6
- valid_options %i(if message on unless)
6
+ valid_options %w(if message on unless)
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 %i(reject_if)
5
- valid_options %i(allow_destroy limit update_only)
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(:belong_to) do
2
2
  include Remockable::ActiveRecord::Helpers
3
3
 
4
- valid_options %i(
4
+ valid_options %w(
5
5
  autosave
6
6
  class_name
7
7
  counter_cache
@@ -1,7 +1,7 @@
1
1
  RSpec::Matchers.define(:have_and_belong_to_many) do
2
2
  include Remockable::ActiveRecord::Helpers
3
3
 
4
- valid_options %i(
4
+ valid_options %w(
5
5
  association_foreign_key
6
6
  autosave
7
7
  class_name
@@ -1,7 +1,7 @@
1
1
  RSpec::Matchers.define(:have_column) do
2
2
  include Remockable::ActiveRecord::Helpers
3
3
 
4
- valid_options %i(default limit null precision scale type)
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 %i()
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 = %i(
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 = %i(
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
@@ -1,7 +1,7 @@
1
1
  RSpec::Matchers.define(:have_index) do
2
2
  include Remockable::ActiveRecord::Helpers
3
3
 
4
- valid_options %i(name unique)
4
+ valid_options %w(name unique)
5
5
 
6
6
  def column_names
7
7
  @column_names ||= expected_as_array.flatten.collect(&:to_s)
@@ -1,7 +1,7 @@
1
1
  RSpec::Matchers.define(:have_many) do
2
2
  include Remockable::ActiveRecord::Helpers
3
3
 
4
- valid_options %i(
4
+ valid_options %w(
5
5
  as
6
6
  autosave
7
7
  class_name
@@ -1,7 +1,7 @@
1
1
  RSpec::Matchers.define(:have_one) do
2
2
  include Remockable::ActiveRecord::Helpers
3
3
 
4
- valid_options %i(
4
+ valid_options %w(
5
5
  class_name
6
6
  dependent
7
7
  foreign_key
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:have_scope) do |*name|
3
3
 
4
4
  attr_accessor :relation
5
5
 
6
- valid_options %i(with)
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 = %i(
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
@@ -3,7 +3,7 @@ RSpec::Matchers.define(:validate_associated) do
3
3
 
4
4
  type :associated
5
5
 
6
- valid_options %i(if message on unless)
6
+ valid_options %w(if message on unless)
7
7
 
8
8
  match do |actual|
9
9
  validator = validator_for(attribute)
@@ -5,7 +5,7 @@ RSpec::Matchers.define :validate_uniqueness_of do |expected|
5
5
 
6
6
  type :uniqueness
7
7
 
8
- valid_options %i(
8
+ valid_options %w(
9
9
  allow_blank
10
10
  allow_nil
11
11
  case_sensitive
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Remockable
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
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.0
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: 2014-07-22 00:00:00.000000000 Z
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.3.0
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.