i18n_interpolation_spec 1.0.0 → 1.0.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/README.md +4 -1
- data/i18n_interpolation_spec.gemspec +1 -1
- data/lib/i18n_interpolation_spec/matchers/be_a_complete_interpolation_of.rb +3 -1
- data/lib/i18n_interpolation_spec/matchers/have_mutual_interpolation_of.rb +3 -1
- data/lib/i18n_interpolation_spec/matchers/helper.rb +15 -0
- data/lib/i18n_interpolation_spec/version.rb +1 -1
- data/lib/i18n_interpolation_spec.rb +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 241bfaabeaa21d0a5fd0eca92145109336a3de85
|
4
|
+
data.tar.gz: e9fcc7cbaf2bc1400f2498543f7e3501f8d9c5cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
4
|
+
[](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', '>=
|
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
|
-
|
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
|
-
|
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
|
@@ -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.
|
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-
|
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: '
|
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: '
|
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
|