Skip to content

Commit

Permalink
Remove 2 particularly contrived specs
Browse files Browse the repository at this point in the history
They were both identical, failing under jruby, trying to access instance variables etc..
  • Loading branch information
tigrish committed Jul 7, 2012
1 parent af62c27 commit 3bed9d3
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions test/backend/metadata_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,14 @@ def setup
assert translation.translation_metadata.is_a?(Hash)
end

test "translate preserves metadata stored on original Strings" do
store_metadata(:foo, :bar, 'bar')
assert_equal 'bar', I18n.t(:foo, :name => 'David').translation_metadata[:bar]
end

test "translate preserves metadata stored on original Strings (when interpolated)" do
store_metadata(:foo, :bar, 'bar')
assert_equal 'bar', I18n.t(:foo, :name => 'David').translation_metadata[:bar]
end

test "translate adds the locale to metadata on Strings" do
assert_equal :en, I18n.t(:foo, :name => 'David', :locale => :en).translation_metadata[:locale]
end

test "translate adds the key to metadata on Strings" do
assert_equal :foo, I18n.t(:foo, :name => 'David').translation_metadata[:key]
end
#

test "translate adds the default to metadata on Strings" do
assert_equal 'bar', I18n.t(:foo, :default => 'bar', :name => '').translation_metadata[:default]
end
Expand All @@ -53,15 +43,5 @@ def setup
test "metadata works with frozen values" do
assert_equal(1, I18n.t(:missing, :count => 1, :default => 'foo'.freeze).translation_metadata[:count])
end

protected

def translations
I18n.backend.instance_variable_get(:@translations)
end

def store_metadata(key, name, value)
translations[:en][key].translation_metadata[name] = value
end
end

0 comments on commit 3bed9d3

Please sign in to comment.