Sha256: 108e6811ac14d477cfa96a4a584c414f2720c264373f1fc9b53522606eebf147

Contents?: true

Size: 883 Bytes

Versions: 80

Compression:

Stored size: 883 Bytes

Contents

# tc_highline_string.rb
#
#  Created by Richard LeBer 2011-06-27
#
#  This is Free Software.  See LICENSE and COPYING for details.

require "test/unit"

require "highline"
require "stringio"
require "string_methods"

class TestHighLineString < Test::Unit::TestCase
  def setup
    @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_raise(::NoMethodError) { "string".color(:blue) }
  end
end

Version data entries

80 entries across 70 versions & 12 rubygems

Version Path
brakeman-3.3.4 bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_highline.rb
brakeman-3.3.3 bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_highline.rb
windows-pr-1.2.5 vendor/bundle/ruby/2.2.0/gems/win32-api-1.6.0-universal-mingw32/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_string_highline.rb
brakeman-3.3.2 bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_highline.rb
win32-api-1.6.0-universal-mingw32 vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/test/tc_string_highline.rb
brakeman-3.3.1 bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_highline.rb
brakeman-3.3.0 bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_highline.rb
highline-1.7.8 test/tc_string_highline.rb
highline-1.7.7 test/tc_string_highline.rb
highline-1.7.6 test/tc_string_highline.rb
highline-1.7.5 test/tc_string_highline.rb
highline-1.7.3 test/tc_string_highline.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/highline-1.6.21/test/tc_string_highline.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/highline-1.6.21/test/tc_string_highline.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/highline-1.7.2/test/tc_string_highline.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/highline-1.6.21/test/tc_string_highline.rb
highline-1.7.2 test/tc_string_highline.rb
highline-1.7.1 test/tc_string_highline.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/test/tc_string_highline.rb
clone-1.0.0.beta2 module/gems/highline-1.6.19/test/tc_string_highline.rb