diff options
author | Salim Afiune <afiune@chef.io> | 2017-03-13 11:11:11 -0400 |
---|---|---|
committer | Tom Duffield <tom@chef.io> | 2017-03-17 11:46:12 -0500 |
commit | b05a1fedf2993a26139e8ac8d0242c97e7c21351 (patch) | |
tree | b0dcd01dda0ab89c306caafa4d58793d03fe3342 /spec/functional | |
parent | 8dffb0360593377710a2b71ae6493ed6bb30acd7 (diff) | |
download | chef-b05a1fedf2993a26139e8ac8d0242c97e7c21351.tar.gz |
Add Shell SoloSession tests
Signed-off-by: Salim Afiune <afiune@chef.io>
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/shell_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/functional/shell_spec.rb b/spec/functional/shell_spec.rb index 636162fb16..8c8d7ba482 100644 --- a/spec/functional/shell_spec.rb +++ b/spec/functional/shell_spec.rb @@ -135,6 +135,24 @@ describe Shell do expect(exitstatus).to eq(0) end + context "on solo mode" do + it "starts correctly" do + output, exitstatus = run_chef_shell_with("--solo") + expect(output).to include("done") + expect(exitstatus).to eq(0) + end + + it "should be able to use the API" do + output, exitstatus = run_chef_shell_with("-s") do |out, keyboard| + simple_api_get = "api.get('data')" + keyboard.puts(simple_api_get) + read_until(out, simple_api_get) + end + expect(output).to include("{}") + expect(exitstatus).to eq(0) + end + end + it "sets the override_runlist from the command line" do output, exitstatus = run_chef_shell_with("-o 'override::foo,override::bar'") do |out, keyboard| show_recipes_code = %q[puts "#{node["recipes"].inspect}"] |