Permalink
Browse files

properly test localized strings with a real file

  • Loading branch information...
1 parent 5b09c3e commit 3ddb628ace58c1a87c4416669e84103c3851c43a @clayallsopp clayallsopp committed May 29, 2013
Showing with 6 additions and 16 deletions.
  1. +1 −0 resources/Localizable.strings
  2. +5 −16 spec/motion/core_spec.rb
@@ -0,0 +1 @@
+"real_key" = "Real Key";
View
@@ -54,27 +54,16 @@
describe "Localized string" do
it "loads the string from NSBundle" do
- key = 'fake_key'
- value = 'fake_value'
-
- bundle = NSBundle.mainBundle
- def bundle.arguments; @arguments; end
- def bundle.localizedStringForKey(key, value:value, table:table); @arguments = [key, value, table]; end
-
- BubbleWrap::localized_string(key, value)
- bundle.arguments.should.equal [key, value, nil]
+ key = 'real_key'
+ value = 'Real Key'
+
+ BubbleWrap::localized_string(key, value).should == value
end
it "returns the key if localization not found and no value is given" do
key = 'fake_key'
- value = nil
-
- bundle = NSBundle.mainBundle
- def bundle.arguments; @arguments; end
- def bundle.localizedStringForKey(key, value:value, table:table); @arguments = [key, value, table]; end
- BubbleWrap::localized_string(key)
- bundle.arguments.should.equal [key, key, nil]
+ BubbleWrap::localized_string(key).should == key
end
end

0 comments on commit 3ddb628

Please sign in to comment.