diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb index 2c63ed69f9b..dfbf8079033 100644 --- a/hbase-shell/src/main/ruby/shell.rb +++ b/hbase-shell/src/main/ruby/shell.rb @@ -152,6 +152,7 @@ module Shell puts 'HBase Shell' puts 'Use "help" to get list of supported commands.' puts 'Use "exit" to quit this interactive shell.' + puts 'For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell' print 'Version ' command('version') puts diff --git a/hbase-shell/src/test/ruby/shell/shell_test.rb b/hbase-shell/src/test/ruby/shell/shell_test.rb index ab150a5478f..c1e9017edbb 100644 --- a/hbase-shell/src/test/ruby/shell/shell_test.rb +++ b/hbase-shell/src/test/ruby/shell/shell_test.rb @@ -21,6 +21,8 @@ require 'hbase_constants' require 'shell' class ShellTest < Test::Unit::TestCase + include Hbase::TestHelpers + def setup @hbase = ::Hbase::Hbase.new($TEST_CLUSTER.getConfiguration) @shell = Shell::Shell.new(@hbase) @@ -69,7 +71,17 @@ class ShellTest < Test::Unit::TestCase @shell.command('version') end - #------------------------------------------------------------------------------- + #----------------------------------------------------------------------------- + + define_test 'Shell::Shell#print_banner should display Reference Guide link' do + @shell.interactive = true + output = capture_stdout { @shell.print_banner } + @shell.interactive = false + link_regex = %r{For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell} + assert_match(link_regex, output) + end + + #----------------------------------------------------------------------------- define_test "Shell::Shell interactive mode should not throw" do # incorrect number of arguments