Sha256: dd7366a97472092993461d3096bae6bade4206520bdb4f1f9b4393f7972b6056
Contents?: true
Size: 596 Bytes
Versions: 22
Compression:
Stored size: 596 Bytes
Contents
require 'test/unit' require 'gettext' class TestGetTextString < Test::Unit::TestCase def test_string_sprintf assert_equal("foo is a number", "%{msg} is a number" % {:msg => "foo"}) assert_equal("bar is a number", "%s is a number" % ["bar"]) assert_equal("bar is a number", "%s is a number" % "bar") assert_equal("1, test", "%{num}, %{record}" % {:num => 1, :record => "test"}) assert_equal("test, 1", "%{record}, %{num}" % {:num => 1, :record => "test"}) assert_equal("1, test", "%d, %s" % [1, "test"]) assert_equal("test, 1", "%2$s, %1$d" % [1, "test"]) end end
Version data entries
22 entries across 22 versions & 1 rubygems