Sha256: 9dfc8b940cfc6589b6ca81f483ff196302e0af8627534ca92ed1cc6507935756

Contents?: true

Size: 598 Bytes

Versions: 14

Compression:

Stored size: 598 Bytes

Contents

require 'rubygems'
gem 'test-unit'

require 'test/unit'
require 'test_helper'

class UtilTest < Test::Unit::TestCase

  def test_stringify
    assert_equal "", Rubber::Util::stringify(nil)
    assert_equal "hi", Rubber::Util::stringify("hi")
    assert_equal "1", Rubber::Util::stringify(1)
    assert_equal "3.4", Rubber::Util::stringify(3.4)
    assert_equal ["1", "2", "r"], Rubber::Util::stringify([1, 2, "r"])
    assert_equal({"1" => "2", "three" => "four"}, Rubber::Util::stringify({1 => 2, :three => "four"}))
    assert_equal [{"3" => "4"}], Rubber::Util::stringify([{3 => 4}])
  end

end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
axtro-rubber-1.2.3 test/util_test.rb
axtro-rubber-1.2.2 test/util_test.rb
rubber-1.5.3 test/util_test.rb
rubber-1.5.2 test/util_test.rb
rubber-1.5.1 test/util_test.rb
rubber-1.5.0 test/util_test.rb
nirvdrum-rubber-2.0.0.rails3.beta6 test/util_test.rb
rubber-1.3.2 test/util_test.rb
rubber-1.3.1 test/util_test.rb
rubber-1.3.0 test/util_test.rb
rubber-1.2.1 test/util_test.rb
axtro-rubber-1.2.1 test/util_test.rb
axtro-rubber-1.2.0 test/util_test.rb
rubber-1.2.0 test/util_test.rb