i18n-spec 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{i18n-spec}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
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}]
12
- s.date = %q{2012-01-14}
12
+ s.date = %q{2012-02-14}
13
13
  s.description = %q{Includes a number of rspec matchers to make specing your locale files easy peasy.}
14
14
  s.email = %q{chris@tigrish.com}
15
15
  s.extra_rdoc_files = [
@@ -5,6 +5,6 @@ RSpec::Matchers.define :have_valid_pluralization_keys do |expected|
5
5
  end
6
6
 
7
7
  failure_message_for_should do |filepath|
8
- "expected #{filepath} to not include invalid pluralization keys :\n- " << @locale_file.errors[:invalid_pluralization_keys].join("\n- ")
8
+ "expected #{filepath} to not contain invalid pluralization keys in the following namespaces :\n- " << @locale_file.errors[:invalid_pluralization_keys].join("\n- ")
9
9
  end
10
10
  end
@@ -31,8 +31,8 @@ module I18nSpec
31
31
  def invalid_pluralization_keys
32
32
  invalid = []
33
33
  pluralizations.each do |parent, pluralization|
34
- pluralization.keys.select do |key, value|
35
- invalid << [parent, key].join('.') unless PLURALIZATION_KEYS.include?(key)
34
+ unless pluralization.keys.all? { |key| PLURALIZATION_KEYS.include?(key) }
35
+ invalid << parent
36
36
  end
37
37
  end
38
38
  @errors[:invalid_pluralization_keys] = invalid unless invalid.empty?
@@ -73,13 +73,13 @@ describe I18nSpec::LocaleFile do
73
73
  other: other"}
74
74
  let(:locale_file) { locale_file_with_content(content) }
75
75
 
76
- it "returns pluralization keys where key is not in PLURALIZATION_KEYS" do
77
- locale_file.invalid_pluralization_keys.should == ['en.cats.tommy', 'en.cats.tabby', 'en.dogs.some']
76
+ it "returns the parent that contains invalid pluralizations" do
77
+ locale_file.invalid_pluralization_keys.should == ['en.cats', 'en.dogs']
78
78
  end
79
79
 
80
80
  it "adds a :invalid_pluralization_keys error with each invalid key" do
81
81
  locale_file.invalid_pluralization_keys
82
- locale_file.errors[:invalid_pluralization_keys].should == ['en.cats.tommy', 'en.cats.tabby', 'en.dogs.some']
82
+ locale_file.errors[:invalid_pluralization_keys].should == ['en.cats', 'en.dogs']
83
83
  end
84
84
  end
85
85
  end
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.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-14 00:00:00.000000000Z
12
+ date: 2012-02-14 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70301793011300 !ruby/object:Gem::Requirement
16
+ requirement: &70148476196620 !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: *70301793011300
24
+ version_requirements: *70148476196620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70301793010720 !ruby/object:Gem::Requirement
27
+ requirement: &70148476194040 !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: *70301793010720
35
+ version_requirements: *70148476194040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &70301793010200 !ruby/object:Gem::Requirement
38
+ requirement: &70148476190820 !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: *70301793010200
46
+ version_requirements: *70148476190820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &70301793009660 !ruby/object:Gem::Requirement
49
+ requirement: &70148476187380 !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: *70301793009660
57
+ version_requirements: *70148476187380
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
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: 3454305248462324191
115
+ hash: 1404050689394788534
116
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements: