Sha256: a9e3f7814dae6f3f1627b9e8718564a3b00f1d590a86279b139c7746ea7658a2
Contents?: true
Size: 964 Bytes
Versions: 26
Compression:
Stored size: 964 Bytes
Contents
require "test_helper" class SshSessionTest < Test::Unit::TestCase setup do @session = mock("session") @klass = Vagrant::SSH::Session @instance = @klass.new(@session) end context "exec!" do should "retry 5 times" do @session.expects(:open_channel).times(5).raises(IOError) assert_raises(IOError) { @instance.exec!("foo") } end end context "checking exit status" do should "raise an ActionException if its non-zero" do assert_raises(Vagrant::Errors::VagrantError) { @instance.check_exit_status(1, "foo") } end should "raise the given exception if specified" do assert_raises(Vagrant::Errors::BaseVMNotFound) { @instance.check_exit_status(1, "foo", :_error_class => Vagrant::Errors::BaseVMNotFound) } end should "raise nothing if its zero" do assert_nothing_raised { @instance.check_exit_status(0, "foo") } end end end
Version data entries
26 entries across 26 versions & 2 rubygems