diff options
author | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-02-27 17:37:43 -0300 |
---|---|---|
committer | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-02-27 17:37:43 -0300 |
commit | fae17f122ca443084777cc1cb6a457e092ef454a (patch) | |
tree | 746938969a948f6d469da1283373534137a5f511 /test/test_string_highline.rb | |
parent | fad3c5d169aa1c2499fd9654f02d9b75fb9e5bed (diff) | |
download | highline-fae17f122ca443084777cc1cb6a457e092ef454a.tar.gz |
Rename all test files to Rake::TestTask default
Diffstat (limited to 'test/test_string_highline.rb')
-rw-r--r-- | test/test_string_highline.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/test_string_highline.rb b/test/test_string_highline.rb new file mode 100644 index 0000000..63e5cfc --- /dev/null +++ b/test/test_string_highline.rb @@ -0,0 +1,39 @@ +# tc_highline_string.rb +# +# Created by Richard LeBer 2011-06-27 +# +# This is Free Software. See LICENSE and COPYING for details. + +require "minitest/autorun" + +require "highline" +require "stringio" +require "string_methods" + +class TestHighLineString < Minitest::Test + def setup + HighLine.reset + @string = HighLine::String.new("string") + end + + def test_string_class + # Basic constructor + assert_equal HighLine::String, @string.class + assert_equal "string", @string + + # Alternative constructor method + new_string = HighLine::String("string") + assert_equal HighLine::String, new_string.class + assert_equal @string, new_string + + # String methods work + assert_equal 6, @string.size + assert_equal "STRING", @string.upcase + end + + include StringMethods + + def test_string_class_is_unchanged + assert_raises(::NoMethodError) { "string".color(:blue) } + end +end |