Skip to content

Commit

Permalink
Merge pull request #58 from kachick/removing_some_warnings
Browse files Browse the repository at this point in the history
Removing some warnings
  • Loading branch information
JEG2 committed Jan 8, 2013
2 parents b2c4e8a + a3726e4 commit e785e6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions lib/highline/system_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ def initialize

module_function

def get_character( input = STDIN )
input.getbyte
end

#
# This section builds character reading and terminal size functions
# to suit the proper platform we're running on. Be warned: Here be
Expand Down Expand Up @@ -186,5 +182,11 @@ def terminal_size
end
end
end

if not defined?(get_character)
def get_character( input = STDIN )
input.getbyte
end
end
end
end
6 changes: 3 additions & 3 deletions test/tc_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def test_code_index

# Add a Style with a new name and code
assert_nil HighLine::Style.code_index['chewie']
s8 = HighLine::Style.new(:name=>:s8, :code=>'chewie')
HighLine::Style.new(:name=>:s8, :code=>'chewie')
assert_equal list_size+1, HighLine::Style.code_index.size
assert_instance_of Array, HighLine::Style.code_index['chewie']
assert_equal 1, HighLine::Style.code_index['chewie'].size
Expand All @@ -388,7 +388,7 @@ def test_code_index

# Add another Style with a new name and code
assert_nil HighLine::Style.code_index['c3po']
s9 = HighLine::Style.new(:name=>:s9, :code=>'c3po')
HighLine::Style.new(:name=>:s9, :code=>'c3po')
assert_equal list_size+2, HighLine::Style.code_index.size
assert_instance_of Array, HighLine::Style.code_index['c3po']
assert_equal 1, HighLine::Style.code_index['c3po'].size
Expand All @@ -397,7 +397,7 @@ def test_code_index

# Add a Style with an existing code
assert_equal 1, HighLine::Style.code_index['c3po'].size
s10 = HighLine::Style.new(:name=>:s10, :code=>'c3po')
HighLine::Style.new(:name=>:s10, :code=>'c3po')
assert_equal list_size+2, HighLine::Style.code_index.size
assert_equal 2, HighLine::Style.code_index['c3po'].size
assert_equal :s10, HighLine::Style.code_index['c3po'].last.name
Expand Down

0 comments on commit e785e6e

Please sign in to comment.