aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb')
-rw-r--r--vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb b/vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb
new file mode 100644
index 000000000..b92c6cda7
--- /dev/null
+++ b/vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb
@@ -0,0 +1,31 @@
+require 'gettext'
+
+class TestNPGetText
+ include GetText
+ bindtextdomain("npgettext", :path => "locale")
+
+ def test_1
+ [np_("Magazine", "a book", "%{num} books", 1),
+ np_("Magazine", "a book", "%{num} books", 2)]
+ end
+
+ def test_2
+ [npgettext("Magazine", "a book", "%{num} books", 1),
+ npgettext("Magazine", "a book", "%{num} books", 2)]
+ end
+
+ def test_3
+ [np_("Hardcover", "a book", "%{num} books", 1),
+ np_("Hardcover", "a book", "%{num} books", 2)]
+ end
+
+ def test_4
+ [np_("Magaine", "I have a magazine", "I have %{num} magazines", 1),
+ np_("Magaine", "I have a magazine", "I have %{num} magazines", 2)]
+ end
+
+ def test_5
+ [np_("Hardcover", "a picture", "%{num} pictures", 1),
+ np_("Hardcover", "a picture", "%{num} pictures", 2)] #not found.
+ end
+end