translate-rails3-plus 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,11 @@
1
- begin
2
- # Using PWD here instead of File.dirname(__FILE__) to be able to symlink to plugin
3
- # from within a Rails app.
4
- require File.expand_path(ENV['PWD'] + '/../../../spec/spec_helper')
5
- rescue LoadError => e
6
- puts "You need to install rspec in your base app\n#{e.message}: #{e.backtrace.join("\n")}"
7
- exit
8
- end
9
-
10
- plugin_spec_dir = File.dirname(__FILE__)
11
- ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log")
1
+ begin
2
+ # Using PWD here instead of File.dirname(__FILE__) to be able to symlink to plugin
3
+ # from within a Rails app.
4
+ require File.expand_path(ENV['PWD'] + '/../../../spec/spec_helper')
5
+ rescue LoadError => e
6
+ puts "You need to install rspec in your base app\n#{e.message}: #{e.backtrace.join("\n")}"
7
+ exit
8
+ end
9
+
10
+ plugin_spec_dir = File.dirname(__FILE__)
11
+ ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log")
data/spec/storage_spec.rb CHANGED
@@ -1,33 +1,33 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe Translate::Storage do
4
- describe "write_to_file" do
5
- before(:each) do
6
- @storage = Translate::Storage.new(:en)
7
- end
8
-
9
- it "writes all I18n messages for a locale to YAML file" do
10
- I18n.backend.should_receive(:translations).and_return(translations)
11
- @storage.stub!(:file_path).and_return(file_path)
12
- file = mock(:file)
13
- file.should_receive(:write).with(translations)
14
- Translate::File.should_receive(:new).with(file_path).and_return(file)
15
- @storage.write_to_file
16
- end
17
-
18
- def file_path
19
- File.join(File.dirname(__FILE__), "files", "en.yml")
20
- end
21
-
22
- def translations
23
- {
24
- :en => {
25
- :article => {
26
- :title => "One Article"
27
- },
28
- :category => "Category"
29
- }
30
- }
31
- end
32
- end
33
- end
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe Translate::Storage do
4
+ describe "write_to_file" do
5
+ before(:each) do
6
+ @storage = Translate::Storage.new(:en)
7
+ end
8
+
9
+ it "writes all I18n messages for a locale to YAML file" do
10
+ I18n.backend.should_receive(:translations).and_return(translations)
11
+ @storage.stub!(:file_path).and_return(file_path)
12
+ file = mock(:file)
13
+ file.should_receive(:write).with(translations)
14
+ Translate::File.should_receive(:new).with(file_path).and_return(file)
15
+ @storage.write_to_file
16
+ end
17
+
18
+ def file_path
19
+ File.join(File.dirname(__FILE__), "files", "en.yml")
20
+ end
21
+
22
+ def translations
23
+ {
24
+ :en => {
25
+ :article => {
26
+ :title => "One Article"
27
+ },
28
+ :category => "Category"
29
+ }
30
+ }
31
+ end
32
+ end
33
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translate-rails3-plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Marklund
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.6.7
97
+ rubygems_version: 2.6.13
98
98
  signing_key:
99
99
  specification_version: 3
100
100
  summary: Newsdesk translate plugin for Rails 3 and above