active_validation 2.6.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +1 -1
  3. data/.gitignore +1 -1
  4. data/.rspec +1 -1
  5. data/.travis.yml +1 -1
  6. data/CODE_OF_CONDUCT.md +1 -1
  7. data/Gemfile +2 -2
  8. data/LICENSE.txt +1 -1
  9. data/README.md +1 -1
  10. data/Rakefile +1 -1
  11. data/active_validation.gemspec +14 -15
  12. data/bin/console +1 -1
  13. data/bin/rake +6 -6
  14. data/bin/setup +1 -1
  15. data/lib/active_validation/matchers/ensure_valid_alpha_format_of.rb +4 -4
  16. data/lib/active_validation/matchers/ensure_valid_alpha_numeric_format_of.rb +4 -4
  17. data/lib/active_validation/matchers/ensure_valid_base64_format_of.rb +4 -4
  18. data/lib/active_validation/matchers/ensure_valid_boolean_format_of.rb +4 -4
  19. data/lib/active_validation/matchers/ensure_valid_coordinate_format_of.rb +4 -4
  20. data/lib/active_validation/matchers/ensure_valid_credit_card_format_of.rb +4 -4
  21. data/lib/active_validation/matchers/ensure_valid_currency_format_of.rb +4 -4
  22. data/lib/active_validation/matchers/ensure_valid_cusip_format_of.rb +4 -4
  23. data/lib/active_validation/matchers/ensure_valid_email_format_of.rb +4 -4
  24. data/lib/active_validation/matchers/ensure_valid_equality_matcher_of.rb +4 -4
  25. data/lib/active_validation/matchers/ensure_valid_hex_format_of.rb +4 -4
  26. data/lib/active_validation/matchers/ensure_valid_imei_format_of.rb +4 -4
  27. data/lib/active_validation/matchers/ensure_valid_ip_format_of.rb +4 -4
  28. data/lib/active_validation/matchers/ensure_valid_isbn_format_of.rb +4 -4
  29. data/lib/active_validation/matchers/ensure_valid_isin_format_of.rb +4 -4
  30. data/lib/active_validation/matchers/ensure_valid_mac_address_format_of.rb +4 -4
  31. data/lib/active_validation/matchers/ensure_valid_name_format_of.rb +4 -4
  32. data/lib/active_validation/matchers/ensure_valid_password_format_of.rb +4 -4
  33. data/lib/active_validation/matchers/ensure_valid_phone_format_of.rb +4 -4
  34. data/lib/active_validation/matchers/ensure_valid_sedol_format_of.rb +4 -4
  35. data/lib/active_validation/matchers/ensure_valid_slug_format_of.rb +4 -4
  36. data/lib/active_validation/matchers/ensure_valid_ssn_format_of.rb +4 -4
  37. data/lib/active_validation/matchers/ensure_valid_tracking_number_format_of.rb +4 -4
  38. data/lib/active_validation/matchers/ensure_valid_type_format_of.rb +3 -3
  39. data/lib/active_validation/matchers/ensure_valid_url_format_of.rb +4 -4
  40. data/lib/active_validation/matchers/ensure_valid_username_format_of.rb +4 -4
  41. data/lib/active_validation/matchers/ensure_valid_uuid_format_of.rb +4 -4
  42. data/lib/active_validation/validators/alpha_numeric_validator.rb +3 -4
  43. data/lib/active_validation/validators/alpha_validator.rb +3 -4
  44. data/lib/active_validation/validators/base64_validator.rb +3 -4
  45. data/lib/active_validation/validators/boolean_validator.rb +4 -4
  46. data/lib/active_validation/validators/coordinate_validator.rb +11 -12
  47. data/lib/active_validation/validators/credit_card_validator.rb +31 -39
  48. data/lib/active_validation/validators/currency_validator.rb +3 -4
  49. data/lib/active_validation/validators/cusip_validator.rb +7 -9
  50. data/lib/active_validation/validators/email_validator.rb +5 -5
  51. data/lib/active_validation/validators/equality_validator.rb +9 -13
  52. data/lib/active_validation/validators/hex_validator.rb +3 -4
  53. data/lib/active_validation/validators/imei_validator.rb +6 -8
  54. data/lib/active_validation/validators/ip_validator.rb +3 -4
  55. data/lib/active_validation/validators/isbn_validator.rb +8 -8
  56. data/lib/active_validation/validators/isin_validator.rb +15 -13
  57. data/lib/active_validation/validators/mac_address_validator.rb +8 -12
  58. data/lib/active_validation/validators/name_validator.rb +4 -5
  59. data/lib/active_validation/validators/password_validator.rb +3 -4
  60. data/lib/active_validation/validators/phone_validator.rb +3 -4
  61. data/lib/active_validation/validators/sedol_validator.rb +6 -8
  62. data/lib/active_validation/validators/slug_validator.rb +3 -4
  63. data/lib/active_validation/validators/ssn_validator.rb +3 -4
  64. data/lib/active_validation/validators/tracking_number_validator.rb +39 -46
  65. data/lib/active_validation/validators/type_validator.rb +1 -1
  66. data/lib/active_validation/validators/url_validator.rb +6 -6
  67. data/lib/active_validation/validators/username_validator.rb +3 -4
  68. data/lib/active_validation/validators/uuid_validator.rb +3 -4
  69. data/lib/active_validation/version.rb +1 -1
  70. data/lib/active_validation.rb +60 -61
  71. metadata +3 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0d9d879a1f9c9282e51f170e2c79b3340611c85
4
- data.tar.gz: ee74c298376f0009c20a514ed0945459bafbdcad
3
+ metadata.gz: e8101533601a42b4554d36e1b2c4d6dddef6b24a
4
+ data.tar.gz: 97f8fe9ad694de008834718099d07c2eb31fa8f7
5
5
  SHA512:
6
- metadata.gz: 482e54bd00f6223ac3ea14b47759c27ae32c2c9542e293da4908a7084e524b3b8b90b9d72c488d27a43cee3c72854f3477279f7a541b52fa2cdeb29a4fe0b5f2
7
- data.tar.gz: 9ff5492577d2a2acf287e22684947b18055980200670e1932e593f4f5bed8ee5e00fb1a9e7a9643124250104831153df30004a31a908168893bc2b5321e09467
6
+ metadata.gz: fb2688046d3bca2af4a968c369d421a0c84de94b70432090263d933b3a5682b10c0f533751a5280c40d9723ad6a638fe25be6d6830925d992ba1025d75147508
7
+ data.tar.gz: fb88e6eb295209133b247b76ebb459637130f03f6be33af535434e0653094bd96721571713de7b5bcd500ff18a6302a30cdfd6da9d59575a9cfe480c0c9589bc
data/.coveralls.yml CHANGED
@@ -1 +1 @@
1
- service_name: travis-ci
1
+ service_name: travis-ci
data/.gitignore CHANGED
@@ -6,4 +6,4 @@
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
- /tmp/
9
+ /tmp/
data/.rspec CHANGED
@@ -1,4 +1,4 @@
1
1
  --backtrace
2
2
  --color
3
3
  --format progress
4
- --order random
4
+ --order random
data/.travis.yml CHANGED
@@ -10,4 +10,4 @@ notifications:
10
10
  on_success: never
11
11
  rvm:
12
12
  - ruby-head
13
- script: 'bundle exec rake'
13
+ script: 'bundle exec rake'
data/CODE_OF_CONDUCT.md CHANGED
@@ -10,4 +10,4 @@ Project maintainers have the right and responsibility to remove, edit, or reject
10
10
 
11
11
  Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
12
 
13
- This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in active_validation.gemspec
4
- gemspec
4
+ gemspec
data/LICENSE.txt CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/active_validation.svg)](http://badge.fury.io/rb/active_validation)
4
4
  [![Build Status](https://travis-ci.org/drexed/active_validation.svg?branch=master)](https://travis-ci.org/drexed/active_validation)
5
- [![Coverage Status](https://coveralls.io/repos/drexed/active_validation/badge.png)](https://coveralls.io/r/drexed/active_validation)
5
+ [![Coverage Status](https://coveralls.io/repos/github/drexed/active_validation/badge.svg?branch=master)](https://coveralls.io/github/drexed/active_validation?branch=master)
6
6
 
7
7
  ActiveValidation is a collection of custom validators that are often required in Rails applications plus shoulda-style RSpec matchers to test the validation rules.
8
8
 
data/Rakefile CHANGED
@@ -1,3 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- task default: :spec
3
+ task default: :spec
@@ -1,31 +1,30 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'active_validation/version'
4
+ require "active_validation/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "active_validation"
8
- spec.version = ActiveValidation::VERSION
9
- spec.authors = ["Juan Gomez"]
10
- spec.email = ["j.gomez@drexed.com"]
7
+ spec.name = "active_validation"
8
+ spec.version = ActiveValidation::VERSION
9
+ spec.authors = ["Juan Gomez"]
10
+ spec.email = ["j.gomez@drexed.com"]
11
11
 
12
- spec.summary = %q{Gem for commonly used validators.}
13
- spec.description = %q{Validate commonly used attributes easily with ActiveValidation.}
14
- spec.homepage = "https://github.com/drexed/active_validation"
15
- spec.license = "MIT"
12
+ spec.summary = %q{Gem for commonly used validators.}
13
+ spec.description = %q{Validate commonly used attributes easily with ActiveValidation.}
14
+ spec.homepage = "http://drexed.github.io/active_validation"
15
+ spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_runtime_dependency "activemodel"
23
23
  spec.add_runtime_dependency "activesupport"
24
- spec.add_runtime_dependency "active_object"
25
24
 
26
25
  spec.add_development_dependency "bundler"
27
26
  spec.add_development_dependency "coveralls"
28
27
  spec.add_development_dependency "rake"
29
28
  spec.add_development_dependency "rspec"
30
29
  spec.add_development_dependency "shoulda"
31
- end
30
+ end
data/bin/console CHANGED
@@ -11,4 +11,4 @@ require "active_validation"
11
11
  # Pry.start
12
12
 
13
13
  require "irb"
14
- IRB.start
14
+ IRB.start
data/bin/rake CHANGED
@@ -2,15 +2,15 @@
2
2
  #
3
3
  # This file was generated by Bundler.
4
4
  #
5
- # The application 'rake' is installed as part of a gem, and
5
+ # The application "rake" is installed as part of a gem, and
6
6
  # this file is here to facilitate running it.
7
7
  #
8
8
 
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
11
11
  Pathname.new(__FILE__).realpath)
12
12
 
13
- require 'rubygems'
14
- require 'bundler/setup'
13
+ require "rubygems"
14
+ require "bundler/setup"
15
15
 
16
- load Gem.bin_path('rake', 'rake')
16
+ load Gem.bin_path("rake", "rake")
data/bin/setup CHANGED
@@ -4,4 +4,4 @@ IFS=$'\n\t'
4
4
 
5
5
  bundle install
6
6
 
7
- # Do any other automated setup that you need to do here
7
+ # Do any other automated setup that you need to do here
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_alpha_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.alpha'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.alpha"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_alpha_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_alpha_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_alpha_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_alpha_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_alpha_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_alpha_numeric_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.alpha_numeric'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.alpha_numeric"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_alpha_numeric_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_alpha_numeric_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_alpha_numeric_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_alpha_numeric_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_alpha_numeric_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_base64_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.base64'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.base64"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_base64_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_base64_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_base64_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_base64_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_base64_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_boolean_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.boolean'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.boolean"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_boolean_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_boolean_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_boolean_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_boolean_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_boolean_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_coordinate_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.coordinate.coordinate'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.coordinate.coordinate"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_coordinate_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_coordinate_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_coordinate_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_coordinate_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_coordinate_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_credit_card_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.credit_card'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.credit_card"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_credit_card_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_credit_card_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_credit_card_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_credit_card_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_credit_card_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_currency_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.currency'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.currency"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_currency_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_currency_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_currency_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_currency_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_currency_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_cusip_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.cusip'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.cusip"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_cusip_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_cusip_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_cusip_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_cusip_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_cusip_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_email_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.email'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.email"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_email_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_email_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_email_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_email_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_email_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -16,13 +16,13 @@ RSpec::Matchers.define :ensure_equality_of do |attribute|
16
16
  model.valid?
17
17
 
18
18
  if model.errors.has_key?(attribute)
19
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.equality', attr: @to, operator: @operator))
19
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.equality", attr: @to, operator: @operator))
20
20
  end
21
21
  end
22
22
 
23
23
  failure_message do |model|
24
24
  I18n.t(
25
- 'active_validation.errors.matchers.ensure_valid_equality_format_of.failure_message_for_should',
25
+ "active_validation.errors.matchers.ensure_valid_equality_format_of.failure_message_for_should",
26
26
  attr: attribute.inspect,
27
27
  model: model.class.name,
28
28
  operator: "operator"
@@ -31,10 +31,10 @@ RSpec::Matchers.define :ensure_equality_of do |attribute|
31
31
 
32
32
  failure_message_when_negated do |model|
33
33
  I18n.t(
34
- 'active_validation.errors.matchers.ensure_valid_equality_format_of.failure_message_for_should_not',
34
+ "active_validation.errors.matchers.ensure_valid_equality_format_of.failure_message_for_should_not",
35
35
  attr: attribute.inspect,
36
36
  model: model.class.name,
37
37
  operator: "operator"
38
38
  )
39
39
  end
40
- end
40
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_hex_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.hex'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.hex"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_hex_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_hex_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_hex_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_hex_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_hex_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_imei_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.imei'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.imei"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_imei_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_imei_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_imei_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_imei_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_imei_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_ip_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.ip'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.ip"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_ip_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_ip_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_ip_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_ip_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_ip_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_isbn_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.isbn'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.isbn"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_isbn_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_isbn_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_isbn_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_isbn_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_isbn_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_isin_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.isin'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.isin"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_isin_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_isin_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_isin_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_isin_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_isin_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end
@@ -4,13 +4,13 @@ RSpec::Matchers.define :ensure_valid_mac_address_format_of do |attribute|
4
4
  model.valid?
5
5
 
6
6
  if model.errors.has_key?(attribute)
7
- model.errors[attribute].include?(I18n.t('active_validation.errors.messages.mac_address'))
7
+ model.errors[attribute].include?(I18n.t("active_validation.errors.messages.mac_address"))
8
8
  end
9
9
  end
10
10
 
11
11
  failure_message do |model|
12
12
  I18n.t(
13
- 'active_validation.errors.matchers.ensure_valid_mac_address_format_of.failure_message_for_should',
13
+ "active_validation.errors.matchers.ensure_valid_mac_address_format_of.failure_message_for_should",
14
14
  attr: attribute.inspect,
15
15
  model: model.class.name
16
16
  )
@@ -18,9 +18,9 @@ RSpec::Matchers.define :ensure_valid_mac_address_format_of do |attribute|
18
18
 
19
19
  failure_message_when_negated do |model|
20
20
  I18n.t(
21
- 'active_validation.errors.matchers.ensure_valid_mac_address_format_of.failure_message_for_should_not',
21
+ "active_validation.errors.matchers.ensure_valid_mac_address_format_of.failure_message_for_should_not",
22
22
  attr: attribute.inspect,
23
23
  model: model.class.name
24
24
  )
25
25
  end
26
- end
26
+ end