i18n_interpolation_spec 1.0.0 → 1.0.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: 3c8467ae5c07c2e23012dfa774dea5738ba563d2
4
- data.tar.gz: 6645ce1d131d67bbc47ae39ceabc4d3c8406d30b
3
+ metadata.gz: 241bfaabeaa21d0a5fd0eca92145109336a3de85
4
+ data.tar.gz: e9fcc7cbaf2bc1400f2498543f7e3501f8d9c5cf
5
5
  SHA512:
6
- metadata.gz: 77226457dc91514362ea632ea407447009c06b94f702d60e4d672cbe5cb09fe8c059e9c7edddced953772cfc57b0e8d458fcff511c1879b88554044a6abe9963
7
- data.tar.gz: 42c18de0594a5c78ba95f8afc70329df7b268ca3e1dd8c06a2ff101351ab24720da6d3ba2e840bb3f426108c37c69b43b9c42d0127cd35ce9567135b20119cce
6
+ metadata.gz: 9f376b71a05c389bde0026fb484a79c536184028eed43b92ea5c5507e03c74fbba9d1091577d45eecf910d6e8ca52962f21bb097ecfa45e8fff3026b03f81dd2
7
+ data.tar.gz: 06069f8d8b59bbceeaae3d89b1e06b22eb24c13c1fad9daf47b3c4858ad6448cc6376a2db4b020dc6ca1d4db9c1592b700b6ce124413d35de3e40dca3e3b867d
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  i18n_interpolation_spec
2
2
  =======================
3
3
 
4
- **i18n_interpolation_spec provides RSpec matchers for testing the completeness of interpolation arguments in locale files.**
4
+ [![Circle CI](https://circleci.com/gh/creasty/i18n_interpolation_spec/tree/master.svg?style=svg)](https://circleci.com/gh/creasty/i18n_interpolation_spec/tree/master)
5
+
6
+ **i18n_interpolation_spec provides RSpec matchers for testing the completeness of interpolation arguments in locale files.**
7
+
5
8
  It's great to use with [tigrish/i18n-spec](https://github.com/tigrish/i18n-spec).
6
9
 
7
10
 
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'rspec', '>= 3.0'
21
+ spec.add_dependency 'rspec', '>= 2.0'
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.7'
24
24
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -1,5 +1,7 @@
1
1
  RSpec::Matchers.define :be_a_complete_interpolation_of do |subject_filepath, except: []|
2
2
 
3
+ extend I18nInterpolationSpec::Helper
4
+
3
5
  match do |object_filepath|
4
6
  object_locale = I18nInterpolationSpec::LocaleFile.new object_filepath
5
7
  subject_locale = I18nInterpolationSpec::LocaleFile.new subject_filepath
@@ -10,7 +12,7 @@ RSpec::Matchers.define :be_a_complete_interpolation_of do |subject_filepath, exc
10
12
  @missing_args.empty?
11
13
  end
12
14
 
13
- failure_message do |filepath|
15
+ failed do |filepath|
14
16
  listed = @missing_args.map do |(scope, args)|
15
17
  args = args.map { |arg| '%%{%s}' % arg }.join ', '
16
18
  "\n - %s should have %s" % [scope, args]
@@ -1,5 +1,7 @@
1
1
  RSpec::Matchers.define :have_mutual_interpolation_of do |subject_filepath, except: []|
2
2
 
3
+ extend I18nInterpolationSpec::Helper
4
+
3
5
  match do |object_filepath|
4
6
  object_locale = I18nInterpolationSpec::LocaleFile.new object_filepath
5
7
  subject_locale = I18nInterpolationSpec::LocaleFile.new subject_filepath
@@ -10,7 +12,7 @@ RSpec::Matchers.define :have_mutual_interpolation_of do |subject_filepath, excep
10
12
  @missing_args.empty?
11
13
  end
12
14
 
13
- failure_message do |filepath|
15
+ failed do |filepath|
14
16
  listed = @missing_args.map do |(scope, args)|
15
17
  args = args.map { |arg| '%%{%s}' % arg }.join ', '
16
18
  "\n - %s should have %s" % [scope, args]
@@ -0,0 +1,15 @@
1
+ module I18nInterpolationSpec
2
+ module Helper
3
+
4
+ def failed(&block)
5
+ if respond_to? :failure_message
6
+ # Rspec 3
7
+ failure_message { |f| instance_exec(f, &block) }
8
+ else
9
+ # Rspec 2
10
+ failure_message_for_should { |f| instance_exec(f, &block) }
11
+ end
12
+ end
13
+
14
+ end
15
+ end
@@ -2,7 +2,7 @@ module I18nInterpolationSpec
2
2
 
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- REVISION = 0
5
+ REVISION = 1
6
6
 
7
7
  VERSION = [MAJOR, MINOR, REVISION].compact.join '.'
8
8
 
@@ -1,6 +1,7 @@
1
1
  require_relative 'i18n_interpolation_spec/version'
2
2
  require_relative 'i18n_interpolation_spec/checker'
3
3
  require_relative 'i18n_interpolation_spec/locale_file'
4
+ require_relative 'i18n_interpolation_spec/matchers/helper'
4
5
  require_relative 'i18n_interpolation_spec/matchers/have_mutual_interpolation_of'
5
6
  require_relative 'i18n_interpolation_spec/matchers/be_a_complete_interpolation_of'
6
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_interpolation_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki Iwanaga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-22 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +73,7 @@ files:
73
73
  - lib/i18n_interpolation_spec/locale_file.rb
74
74
  - lib/i18n_interpolation_spec/matchers/be_a_complete_interpolation_of.rb
75
75
  - lib/i18n_interpolation_spec/matchers/have_mutual_interpolation_of.rb
76
+ - lib/i18n_interpolation_spec/matchers/helper.rb
76
77
  - lib/i18n_interpolation_spec/version.rb
77
78
  - spec/fixtures/base.yml
78
79
  - spec/fixtures/complete.yml