i18n-spec 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/i18n-spec.gemspec
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
-
RSpec::Matchers.define :be_a_complete_translation_of do |
|
2
|
-
match do |
|
3
|
-
locale_file = I18nSpec::LocaleFile.new(
|
4
|
-
|
1
|
+
RSpec::Matchers.define :be_a_complete_translation_of do |default_locale_filepath|
|
2
|
+
match do |filepath|
|
3
|
+
locale_file = I18nSpec::LocaleFile.new(filepath)
|
4
|
+
default_locale = I18nSpec::LocaleFile.new(default_locale_filepath)
|
5
|
+
@misses = default_locale.flattened_translations.keys.reject do |key|
|
6
|
+
locale_file.flattened_translations.keys.include?(key)
|
7
|
+
end
|
8
|
+
@misses.empty?
|
9
|
+
end
|
10
|
+
|
11
|
+
failure_message_for_should do |filepath|
|
12
|
+
"expected #{filepath} to include :\n- " << @misses.join("\n- ")
|
5
13
|
end
|
6
14
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
RSpec::Matchers.define :be_a_subset_of do |
|
2
|
-
match do |
|
3
|
-
|
4
|
-
|
5
|
-
@superset =
|
6
|
-
|
1
|
+
RSpec::Matchers.define :be_a_subset_of do |default_locale_filepath|
|
2
|
+
match do |filepath|
|
3
|
+
locale_file = I18nSpec::LocaleFile.new(filepath)
|
4
|
+
default_locale = I18nSpec::LocaleFile.new(default_locale_filepath)
|
5
|
+
@superset = locale_file.flattened_translations.keys.reject do |key|
|
6
|
+
default_locale.flattened_translations.keys.include?(key)
|
7
7
|
end
|
8
8
|
@superset.empty?
|
9
9
|
end
|
10
10
|
|
11
|
-
failure_message_for_should do |
|
12
|
-
"expected #{
|
11
|
+
failure_message_for_should do |filepath|
|
12
|
+
"expected #{filepath} to not include :\n- " << @superset.join("\n- ")
|
13
13
|
end
|
14
14
|
end
|
@@ -40,13 +40,6 @@ module I18nSpec
|
|
40
40
|
translations.keys.first == File.basename(@filepath, File.extname(@filepath))
|
41
41
|
end
|
42
42
|
|
43
|
-
def is_a_complete_tranlsation_of?(default_locale_filepath)
|
44
|
-
default_locale = LocaleFile.new(default_locale_filepath)
|
45
|
-
default_keys = flatten_tree(translations.values.first).keys.sort
|
46
|
-
keys = flatten_tree(default_locale.translations.values.first).keys.sort
|
47
|
-
keys == default_keys
|
48
|
-
end
|
49
|
-
|
50
43
|
protected
|
51
44
|
|
52
45
|
def flatten_tree(data, prefix = '', result = {})
|
data/spec/fixtures/fr.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-15 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70339104058560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.3.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70339104058560
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &70339104058080 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.10
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70339104058080
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70339104057600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70339104057600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rcov
|
49
|
-
requirement: &
|
49
|
+
requirement: &70339104057120 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70339104057120
|
58
58
|
description: Includes a number of rspec matchers to make specing your locale files
|
59
59
|
easy peasy.
|
60
60
|
email: chris@tigrish.com
|
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
segments:
|
110
110
|
- 0
|
111
|
-
hash:
|
111
|
+
hash: 1876521983726256172
|
112
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
113
|
none: false
|
114
114
|
requirements:
|