i18n-spec 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.9.2@i18n-spec
data/.travis.yml ADDED
@@ -0,0 +1 @@
1
+ rvm: 1.9.2
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ gem 'psych'
4
4
 
5
5
  group :development do
6
6
  gem "rspec", "~> 2.3.0"
7
- gem "bundler", "~> 1.1.rc.3"
7
+ gem "bundler"
8
8
  gem "jeweler", "~> 1.6.4"
9
9
  gem "rcov", ">= 0"
10
10
  end
data/Gemfile.lock CHANGED
@@ -23,7 +23,7 @@ PLATFORMS
23
23
  ruby
24
24
 
25
25
  DEPENDENCIES
26
- bundler (~> 1.1.rc.3)
26
+ bundler
27
27
  jeweler (~> 1.6.4)
28
28
  psych
29
29
  rcov
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # RSpec matchers for I18n files
2
2
 
3
+ i18n-spec provides RSpec matchers for testing your locale files.
4
+
3
5
  ## Implemented matchers
4
6
 
5
7
  describe "config/locales/en.yml" do
@@ -7,6 +9,20 @@
7
9
  it { should have_valid_pluralization_keys }
8
10
  end
9
11
 
12
+ All of these tests can be ran with a shared example :
13
+
14
+ describe "A locale file" do
15
+ it_behaves_like 'a valid locale file', 'config/locales/en.yml'
16
+ end
17
+
18
+ You can run all of these tests for every file in a directory like so :
19
+
20
+ Dir.glob('config/locale/*.yml') do |locale_file|
21
+ describe "a locale file" do
22
+ it_behaves_like 'a valid locale file', locale_file
23
+ end
24
+ end
25
+
10
26
  ## TODO
11
27
 
12
28
  describe "config/locales/fr.yml" do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
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.1"
8
+ s.version = "0.0.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{2011-12-12}
12
+ s.date = %q{2011-12-13}
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 = [
@@ -19,6 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  ".rspec",
22
+ ".rvmrc",
23
+ ".travis.yml",
22
24
  "Gemfile",
23
25
  "Gemfile.lock",
24
26
  "LICENSE.txt",
@@ -30,6 +32,7 @@ Gem::Specification.new do |s|
30
32
  "lib/i18n-spec/matchers/be_parseable_matcher.rb",
31
33
  "lib/i18n-spec/matchers/have_valid_pluralization_keys_matcher.rb",
32
34
  "lib/i18n-spec/models/locale_file.rb",
35
+ "lib/i18n-spec/shared_examples/valid_locale_file.rb",
33
36
  "spec/fixtures/en.yml",
34
37
  "spec/fixtures/invalid_pluralization_keys.yml",
35
38
  "spec/fixtures/unparseable.yml",
@@ -48,20 +51,20 @@ Gem::Specification.new do |s|
48
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
52
  s.add_runtime_dependency(%q<psych>, [">= 0"])
50
53
  s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
51
- s.add_development_dependency(%q<bundler>, ["~> 1.1.rc.3"])
54
+ s.add_development_dependency(%q<bundler>, [">= 0"])
52
55
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
53
56
  s.add_development_dependency(%q<rcov>, [">= 0"])
54
57
  else
55
58
  s.add_dependency(%q<psych>, [">= 0"])
56
59
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
57
- s.add_dependency(%q<bundler>, ["~> 1.1.rc.3"])
60
+ s.add_dependency(%q<bundler>, [">= 0"])
58
61
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
59
62
  s.add_dependency(%q<rcov>, [">= 0"])
60
63
  end
61
64
  else
62
65
  s.add_dependency(%q<psych>, [">= 0"])
63
66
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
64
- s.add_dependency(%q<bundler>, ["~> 1.1.rc.3"])
67
+ s.add_dependency(%q<bundler>, [">= 0"])
65
68
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
66
69
  s.add_dependency(%q<rcov>, [">= 0"])
67
70
  end
@@ -0,0 +1,6 @@
1
+ shared_examples_for "a valid locale file" do |locale_file|
2
+ describe locale_file do
3
+ it { should be_parseable }
4
+ it { should have_valid_pluralization_keys }
5
+ end
6
+ end
data/lib/i18n-spec.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  require 'psych'
2
2
  Dir[File.dirname(__FILE__) + '/i18n-spec/models/*.rb'].each {|file| require file }
3
- Dir[File.dirname(__FILE__) + '/i18n-spec/matchers/*.rb'].each {|file| require file }
3
+ Dir[File.dirname(__FILE__) + '/i18n-spec/matchers/*.rb'].each {|file| require file }
4
+ Dir[File.dirname(__FILE__) + '/i18n-spec/shared_examples/*.rb'].each {|file| require file }
@@ -1,8 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "spec/fixtures/en.yml" do
4
- it { should be_parseable }
5
- it { should have_valid_pluralization_keys }
3
+ describe "Valid file" do
4
+ it_behaves_like "a valid locale file", 'spec/fixtures/en.yml'
6
5
  end
7
6
 
8
7
  describe "Invalid files" do
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.1
4
+ version: 0.0.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: 2011-12-12 00:00:00.000000000 Z
12
+ date: 2011-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: psych
16
- requirement: &70252597055820 !ruby/object:Gem::Requirement
16
+ requirement: &70264021225740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70252597055820
24
+ version_requirements: *70264021225740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70252597055340 !ruby/object:Gem::Requirement
27
+ requirement: &70264021225260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: 2.3.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70252597055340
35
+ version_requirements: *70264021225260
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70252597072000 !ruby/object:Gem::Requirement
38
+ requirement: &70264021224780 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ~>
41
+ - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
- version: 1.1.rc.3
43
+ version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70252597072000
46
+ version_requirements: *70264021224780
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &70252597071520 !ruby/object:Gem::Requirement
49
+ requirement: &70264021240660 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70252597071520
57
+ version_requirements: *70264021240660
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rcov
60
- requirement: &70252597071040 !ruby/object:Gem::Requirement
60
+ requirement: &70264021240180 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70252597071040
68
+ version_requirements: *70264021240180
69
69
  description: Includes a number of rspec matchers to make specing your locale files
70
70
  easy peasy.
71
71
  email: chris@tigrish.com
@@ -77,6 +77,8 @@ extra_rdoc_files:
77
77
  files:
78
78
  - .document
79
79
  - .rspec
80
+ - .rvmrc
81
+ - .travis.yml
80
82
  - Gemfile
81
83
  - Gemfile.lock
82
84
  - LICENSE.txt
@@ -88,6 +90,7 @@ files:
88
90
  - lib/i18n-spec/matchers/be_parseable_matcher.rb
89
91
  - lib/i18n-spec/matchers/have_valid_pluralization_keys_matcher.rb
90
92
  - lib/i18n-spec/models/locale_file.rb
93
+ - lib/i18n-spec/shared_examples/valid_locale_file.rb
91
94
  - spec/fixtures/en.yml
92
95
  - spec/fixtures/invalid_pluralization_keys.yml
93
96
  - spec/fixtures/unparseable.yml
@@ -108,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
111
  version: '0'
109
112
  segments:
110
113
  - 0
111
- hash: -2631954337597545255
114
+ hash: -2929736961918545880
112
115
  required_rubygems_version: !ruby/object:Gem::Requirement
113
116
  none: false
114
117
  requirements: