summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-05-01 16:36:11 +0100
committerThom May <thom@may.lt>2015-05-01 16:36:11 +0100
commit614a1367376bb92b8293f8bbffc87c21e574470e (patch)
treeca5f4922d258456644b05df0bbd1b91b6315577c
parentb060c84ea46d12a44d26f20eee640b03e9af969e (diff)
parentd1738cc4c83b7d8b1e948599a2ce1f3d84bef533 (diff)
downloadchef-614a1367376bb92b8293f8bbffc87c21e574470e.tar.gz
Merge pull request #3227 from higanworks/show_chef_version_on_shell
Show Chef::VERSION at prompt_c and prompt_i on shell session
-rw-r--r--lib/chef/shell.rb2
-rw-r--r--spec/unit/shell_spec.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index ee4fe78808..3a68785ce9 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -110,7 +110,7 @@ module Shell
conf.prompt_c = "chef#{leader(m)} > "
conf.return_format = " => %s \n"
- conf.prompt_i = "chef#{leader(m)} > "
+ conf.prompt_i = "chef#{leader(m)} (#{Chef::VERSION})> "
conf.prompt_n = "chef#{leader(m)} ?> "
conf.prompt_s = "chef#{leader(m)}%l> "
conf.use_tracer = false
diff --git a/spec/unit/shell_spec.rb b/spec/unit/shell_spec.rb
index acbb1891e7..3a8f1a5346 100644
--- a/spec/unit/shell_spec.rb
+++ b/spec/unit/shell_spec.rb
@@ -71,7 +71,7 @@ describe Shell do
Shell.irb_conf[:IRB_RC].call(conf)
expect(conf.prompt_c).to eq("chef > ")
expect(conf.return_format).to eq(" => %s \n")
- expect(conf.prompt_i).to eq("chef > ")
+ expect(conf.prompt_i).to eq("chef (#{Chef::VERSION})> ")
expect(conf.prompt_n).to eq("chef ?> ")
expect(conf.prompt_s).to eq("chef%l> ")
expect(conf.use_tracer).to eq(false)
@@ -85,7 +85,7 @@ describe Shell do
conf.main = Chef::Recipe.new(nil,nil,Chef::RunContext.new(Chef::Node.new, {}, events))
Shell.irb_conf[:IRB_RC].call(conf)
expect(conf.prompt_c).to eq("chef:recipe > ")
- expect(conf.prompt_i).to eq("chef:recipe > ")
+ expect(conf.prompt_i).to eq("chef:recipe (#{Chef::VERSION})> ")
expect(conf.prompt_n).to eq("chef:recipe ?> ")
expect(conf.prompt_s).to eq("chef:recipe%l> ")
end
@@ -97,7 +97,7 @@ describe Shell do
conf.main = Chef::Node.new
Shell.irb_conf[:IRB_RC].call(conf)
expect(conf.prompt_c).to eq("chef:attributes > ")
- expect(conf.prompt_i).to eq("chef:attributes > ")
+ expect(conf.prompt_i).to eq("chef:attributes (#{Chef::VERSION})> ")
expect(conf.prompt_n).to eq("chef:attributes ?> ")
expect(conf.prompt_s).to eq("chef:attributes%l> ")
end