localeapp 0.9.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@ describe Localeapp::Sender, "#post_translation(locale, key, options, value = nil
18
18
 
19
19
  def expect_execute
20
20
  # have to stub RestClient here as FakeWeb doesn't support looking at the post body yet
21
- RestClient::Request.should_receive(:execute).with(hash_including(
21
+ expect(RestClient::Request).to receive(:execute).with(hash_including(
22
22
  :url => @sender.translations_url,
23
23
  :payload => data.to_json,
24
24
  :headers => {
@@ -51,10 +51,10 @@ describe Localeapp::Sender, "#post_missing_translations" do
51
51
  { :key => "test.key", :locale => "en" },
52
52
  { :key => "test.key2", :locale => "en" }
53
53
  ]
54
- Localeapp.missing_translations.should_receive(:to_send).and_return(missing_to_send)
54
+ expect(Localeapp.missing_translations).to receive(:to_send).and_return(missing_to_send)
55
55
  data = { :translations => missing_to_send }
56
56
  # have to stub RestClient here as FakeWeb doesn't support looking at the post body yet
57
- RestClient::Request.should_receive(:execute).with(hash_including(
57
+ expect(RestClient::Request).to receive(:execute).with(hash_including(
58
58
  :url => @sender.missing_translations_url,
59
59
  :payload => data.to_json,
60
60
  :headers => {
@@ -65,8 +65,8 @@ describe Localeapp::Sender, "#post_missing_translations" do
65
65
  end
66
66
 
67
67
  it "does nothing if there are no missing translations to send" do
68
- Localeapp.missing_translations.should_receive(:to_send).and_return([])
69
- RestClient.should_not_receive(:post)
68
+ expect(Localeapp.missing_translations).to receive(:to_send).and_return([])
69
+ expect(RestClient).not_to receive(:post)
70
70
  @sender.post_missing_translations
71
71
  end
72
72
  end
@@ -39,7 +39,7 @@ describe Localeapp::Updater, ".update(data)" do
39
39
  'locales' => %w{en es}
40
40
  })
41
41
 
42
- load_yaml('en').should == {
42
+ expect(load_yaml('en')).to eq({
43
43
  'en' => {
44
44
  'foo' => {
45
45
  'monkey' => 'hello',
@@ -51,7 +51,7 @@ describe Localeapp::Updater, ".update(data)" do
51
51
  'scalar1' => nil,
52
52
  'scalar2' => nil,
53
53
  }
54
- }
54
+ })
55
55
  end
56
56
 
57
57
  it "deletes keys in the yml files when updates are empty" do
@@ -65,13 +65,13 @@ describe Localeapp::Updater, ".update(data)" do
65
65
  'locales' => %w{es}
66
66
  })
67
67
 
68
- load_yaml('es').should == {
68
+ expect(load_yaml('es')).to eq({
69
69
  'es' => {
70
70
  'foo' => {
71
71
  'monkey' => 'Mono'
72
72
  }
73
73
  }
74
- }
74
+ })
75
75
  end
76
76
 
77
77
  it "creates a new yml file if an unknown locale is passed" do
@@ -82,11 +82,11 @@ describe Localeapp::Updater, ".update(data)" do
82
82
  'locales' => ['ja']
83
83
  })
84
84
 
85
- load_yaml('ja').should == {
85
+ expect(load_yaml('ja')).to eq({
86
86
  'ja' => {
87
87
  'foo' => 'bar'
88
88
  }
89
- }
89
+ })
90
90
  end
91
91
 
92
92
  it "doesn't delete a namespace having the same name as a previously deleted key" do
@@ -104,13 +104,13 @@ describe Localeapp::Updater, ".update(data)" do
104
104
  'locales' => ['az']
105
105
  })
106
106
 
107
- load_yaml('az').should == {
107
+ expect(load_yaml('az')).to eq({
108
108
  'az' => {
109
109
  'once_deleted' => {
110
110
  'but_not' => 'anymore'
111
111
  }
112
112
  }
113
- }
113
+ })
114
114
  end
115
115
 
116
116
  it "doesn't create a new yml file if an unknown locale is passed but it has no translations" do
@@ -119,7 +119,7 @@ describe Localeapp::Updater, ".update(data)" do
119
119
  'deleted' => ['foo.delete_me'],
120
120
  'locales' => ['ja']
121
121
  })
122
- File.exist?(File.join(@yml_dir, 'ja.yml')).should be_false
122
+ expect(File.exist?(File.join(@yml_dir, 'ja.yml'))).to be false
123
123
  end
124
124
 
125
125
  if defined?(Psych) && defined?(Psych::VERSION) && Psych::VERSION >= "1.1.0" && !RUBY_PLATFORM == 'jruby'
@@ -131,7 +131,7 @@ describe Localeapp::Updater, ".update(data)" do
131
131
  'locales' => ['en'],
132
132
  'deleted' => []
133
133
  })
134
- File.read(File.join(@yml_dir, 'en.yml')).should match(/foo: ! 'bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar '/m)
134
+ expect(File.read(File.join(@yml_dir, 'en.yml'))).to match(/foo: ! 'bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar bar '/m)
135
135
  end
136
136
  end
137
137
 
@@ -157,7 +157,7 @@ describe Localeapp::Updater, ".update(data)" do
157
157
  'locales' => ['ja']
158
158
  })
159
159
  mode = File.stat(File.join(@yml_dir, 'ja.yml')).mode # octal
160
- mode.to_s(8)[3, 3].should == "644"
160
+ expect(mode.to_s(8)[3, 3]).to eq("644")
161
161
  end
162
162
  end
163
163
 
@@ -190,11 +190,11 @@ describe Localeapp::Updater, ".dump(data)" do
190
190
 
191
191
  it "creates a new yml file if an unknown locale is passed" do
192
192
  do_dump({'ja' => { 'foo' => 'bar'} })
193
- YAML.load(File.read(File.join(@yml_dir, 'ja.yml'))).should == {
193
+ expect(YAML.load(File.read(File.join(@yml_dir, 'ja.yml')))).to eq({
194
194
  'ja' => {
195
195
  'foo' => 'bar'
196
196
  }
197
- }
197
+ })
198
198
  end
199
199
 
200
200
  it "doesn't change a yml file's permissions" do
@@ -207,6 +207,6 @@ describe Localeapp::Updater, ".dump(data)" do
207
207
  it "creates new yml files chmodded with 644" do
208
208
  do_dump({'ja' => { 'foo' => 'bar'} })
209
209
  mode = File.stat(File.join(@yml_dir, 'ja.yml')).mode # octal
210
- mode.to_s(8)[3, 3].should == "644"
210
+ expect(mode.to_s(8)[3, 3]).to eq("644")
211
211
  end
212
212
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localeapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Dell
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-02 00:00:00.000000000 Z
12
+ date: 2015-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - <
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: '0.7'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - <
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: '0.7'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: json
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - ~>
117
117
  - !ruby/object:Gem::Version
118
- version: 2.14.1
118
+ version: '3.3'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 2.14.1
125
+ version: '3.3'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: yard
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -155,30 +155,30 @@ dependencies:
155
155
  name: aruba
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - ! '>='
158
+ - - ~>
159
159
  - !ruby/object:Gem::Version
160
- version: '0'
160
+ version: '0.8'
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - ! '>='
165
+ - - ~>
166
166
  - !ruby/object:Gem::Version
167
- version: '0'
167
+ version: '0.8'
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: cucumber
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - ~>
173
173
  - !ruby/object:Gem::Version
174
- version: '1.3'
174
+ version: '2.0'
175
175
  type: :development
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - ~>
180
180
  - !ruby/object:Gem::Version
181
- version: '1.3'
181
+ version: '2.0'
182
182
  - !ruby/object:Gem::Dependency
183
183
  name: fakeweb
184
184
  requirement: !ruby/object:Gem::Requirement
@@ -315,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
315
  version: '0'
316
316
  requirements: []
317
317
  rubyforge_project: localeapp
318
- rubygems_version: 2.4.5
318
+ rubygems_version: 2.4.8
319
319
  signing_key:
320
320
  specification_version: 4
321
321
  summary: Easy i18n translation management with localeapp.com