i18n-spec 0.0.8 → 0.0.9

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.
data/README.md CHANGED
@@ -13,6 +13,7 @@ There are a few matchers available; the subject of the spec is always a path to
13
13
  it { should have_valid_pluralization_keys }
14
14
  it { should have_one_top_level_namespace }
15
15
  it { should be_named_like_top_level_namespace }
16
+ it { should_not have_legacy_interpolations }
16
17
  end
17
18
 
18
19
  All of these tests can be ran in one line with a shared example :
@@ -41,4 +42,4 @@ If you need to test that all translations have been completed :
41
42
 
42
43
  describe "config/locales/fr.yml" do
43
44
  it { should be_a_complete_translation_of 'config/locales/en.yml' }
44
- end
45
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
data/i18n-spec.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{i18n-spec}
8
- s.version = "0.0.8"
8
+ s.version = "0.0.9"
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{2011-12-15}
12
+ s.date = %q{2011-12-21}
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 = [
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
33
33
  "lib/i18n-spec/matchers/be_a_subset_of_matcher.rb",
34
34
  "lib/i18n-spec/matchers/be_named_like_top_level_namespace_matcher.rb",
35
35
  "lib/i18n-spec/matchers/be_parseable_matcher.rb",
36
+ "lib/i18n-spec/matchers/have_legacy_interpolations.rb",
36
37
  "lib/i18n-spec/matchers/have_one_top_level_namespace_matcher.rb",
37
38
  "lib/i18n-spec/matchers/have_valid_pluralization_keys_matcher.rb",
38
39
  "lib/i18n-spec/models/locale_file.rb",
@@ -41,6 +42,7 @@ Gem::Specification.new do |s|
41
42
  "spec/fixtures/es.yml",
42
43
  "spec/fixtures/fr.yml",
43
44
  "spec/fixtures/invalid_pluralization_keys.yml",
45
+ "spec/fixtures/legacy_interpolations.yml",
44
46
  "spec/fixtures/multiple_top_levels.yml",
45
47
  "spec/fixtures/not_subset.yml",
46
48
  "spec/fixtures/unparseable.yml",
@@ -0,0 +1,6 @@
1
+ RSpec::Matchers.define :have_legacy_interpolations do |expected|
2
+ match do |actual|
3
+ locale_file = I18nSpec::LocaleFile.new(actual)
4
+ locale_file.content =~ /{{.+}}/
5
+ end
6
+ end
@@ -8,6 +8,10 @@ module I18nSpec
8
8
  @filepath = filepath
9
9
  end
10
10
 
11
+ def content
12
+ @content ||= IO.read(@filepath)
13
+ end
14
+
11
15
  def translations
12
16
  @translations ||= Psych.load_file(@filepath)
13
17
  end
@@ -65,4 +69,4 @@ module I18nSpec
65
69
  end
66
70
  end
67
71
  end
68
- end
72
+ end
@@ -4,5 +4,6 @@ shared_examples_for "a valid locale file" do |locale_file|
4
4
  it { should have_valid_pluralization_keys }
5
5
  it { should have_one_top_level_namespace }
6
6
  it { should be_named_like_top_level_namespace }
7
+ it { should_not have_legacy_interpolations }
7
8
  end
8
- end
9
+ end
@@ -0,0 +1,4 @@
1
+ en:
2
+ cats:
3
+ one: {{count}} cat
4
+ other: {{count}} cats
@@ -9,6 +9,7 @@ describe "Invalid files" do
9
9
  it { 'spec/fixtures/invalid_pluralization_keys.yml'.should_not have_valid_pluralization_keys }
10
10
  it { 'spec/fixtures/multiple_top_levels.yml'.should_not have_one_top_level_namespace }
11
11
  it { 'spec/fixtures/multiple_top_levels.yml'.should_not be_named_like_top_level_namespace }
12
+ it { 'spec/fixtures/legacy_interpolations.yml'.should have_legacy_interpolations }
12
13
  it { 'spec/fixtures/not_subset.yml'.should_not be_a_subset_of 'spec/fixtures/en.yml' }
13
14
  end
14
15
 
@@ -22,4 +23,4 @@ describe "Translated files" do
22
23
  it { should be_a_subset_of 'spec/fixtures/en.yml' }
23
24
  it { should_not be_a_complete_translation_of 'spec/fixtures/en.yml'}
24
25
  end
25
- end
26
+ 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.0.8
4
+ version: 0.0.9
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: 2011-12-15 00:00:00.000000000Z
12
+ date: 2011-12-21 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70339104058560 !ruby/object:Gem::Requirement
16
+ requirement: &70322522003820 !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: *70339104058560
24
+ version_requirements: *70322522003820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70339104058080 !ruby/object:Gem::Requirement
27
+ requirement: &70322522003340 !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: *70339104058080
35
+ version_requirements: *70322522003340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &70339104057600 !ruby/object:Gem::Requirement
38
+ requirement: &70322522002860 !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: *70339104057600
46
+ version_requirements: *70322522002860
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &70339104057120 !ruby/object:Gem::Requirement
49
+ requirement: &70322522002380 !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: *70339104057120
57
+ version_requirements: *70322522002380
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
@@ -80,6 +80,7 @@ files:
80
80
  - lib/i18n-spec/matchers/be_a_subset_of_matcher.rb
81
81
  - lib/i18n-spec/matchers/be_named_like_top_level_namespace_matcher.rb
82
82
  - lib/i18n-spec/matchers/be_parseable_matcher.rb
83
+ - lib/i18n-spec/matchers/have_legacy_interpolations.rb
83
84
  - lib/i18n-spec/matchers/have_one_top_level_namespace_matcher.rb
84
85
  - lib/i18n-spec/matchers/have_valid_pluralization_keys_matcher.rb
85
86
  - lib/i18n-spec/models/locale_file.rb
@@ -88,6 +89,7 @@ files:
88
89
  - spec/fixtures/es.yml
89
90
  - spec/fixtures/fr.yml
90
91
  - spec/fixtures/invalid_pluralization_keys.yml
92
+ - spec/fixtures/legacy_interpolations.yml
91
93
  - spec/fixtures/multiple_top_levels.yml
92
94
  - spec/fixtures/not_subset.yml
93
95
  - spec/fixtures/unparseable.yml
@@ -108,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
110
  version: '0'
109
111
  segments:
110
112
  - 0
111
- hash: 1876521983726256172
113
+ hash: -2200790858591140101
112
114
  required_rubygems_version: !ruby/object:Gem::Requirement
113
115
  none: false
114
116
  requirements: