Sha256: 406cefe8b1f6a27636018bcb913c02c600dcb6ab76d985097536f0a03fba7964

Contents?: true

Size: 909 Bytes

Versions: 24

Compression:

Stored size: 909 Bytes

Contents

#!/usr/local/bin/ruby -w

# 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

24 entries across 21 versions & 4 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/highline-1.6.12/test/tc_string_highline.rb
challah-0.6.2 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.6.1 vendor/bundle/gems/highline-1.6.12/test/tc_string_highline.rb
challah-0.6.1 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.6.0 vendor/bundle/gems/highline-1.6.12/test/tc_string_highline.rb
challah-0.6.0 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
highline-1.6.12 test/tc_string_highline.rb
challah-0.5.4 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.5.3 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.5.2 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.5.1 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.5.0 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.4.1 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.4.0 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
challah-0.3.5 vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb
domo-0.0.5 vendor/bundle/ruby/1.9.1/gems/highline-1.6.11/test/tc_string_highline.rb
highline-1.6.11 test/tc_string_highline.rb
highline-1.6.10 test/tc_string_highline.rb
highline-1.6.9 test/tc_string_highline.rb