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.7
1
+ 0.0.8
data/i18n-spec.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{i18n-spec}
8
- s.version = "0.0.7"
8
+ s.version = "0.0.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Christopher Dell}]
@@ -1,6 +1,14 @@
1
- RSpec::Matchers.define :be_a_complete_translation_of do |expected|
2
- match do |actual|
3
- locale_file = I18nSpec::LocaleFile.new(actual)
4
- locale_file.is_a_complete_tranlsation_of? expected
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 |expected|
2
- match do |actual|
3
- @locale_file = I18nSpec::LocaleFile.new(actual)
4
- @default_locale = I18nSpec::LocaleFile.new(expected)
5
- @superset = @locale_file.flattened_translations.keys.reject do |key|
6
- @default_locale.flattened_translations.keys.include?(key)
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 |player|
12
- "expected #{@locale_file.filepath} to not include :\n- " << @superset.join("\n- ")#{@superset.join"
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
@@ -1,7 +1,6 @@
1
1
  en:
2
2
  hello: 'osalu'
3
3
  cats:
4
- zero: 'pas de chats'
5
4
  one: 'un chat'
6
5
  other: '%{count} chats'
7
6
  itteh:
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.7
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: &70124619322000 !ruby/object:Gem::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: *70124619322000
24
+ version_requirements: *70339104058560
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70124619321520 !ruby/object:Gem::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: *70124619321520
35
+ version_requirements: *70339104058080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &70124619321040 !ruby/object:Gem::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: *70124619321040
46
+ version_requirements: *70339104057600
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &70124619320560 !ruby/object:Gem::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: *70124619320560
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: 284635574898228492
111
+ hash: 1876521983726256172
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements: