Sha256: 830ce66a860b056556d2aad99a9dec47879ffe1cec139e093cd3769eff531582
Contents?: true
Size: 1.11 KB
Versions: 19
Compression:
Stored size: 1.11 KB
Contents
require File.expand_path("../../../../base", __FILE__) describe Vagrant::Action::Builtin::Confirm do let(:app) { lambda { |env| } } let(:env) { { :ui => double("ui") } } let(:message) { "foo" } ["y", "Y"].each do |valid| it "should set the result to true if '#{valid}' is given" do env[:ui].should_receive(:ask).with(message).and_return(valid) described_class.new(app, env, message).call(env) env[:result].should be end end it "should set the result to true if force matches" do force_key = :tubes env[force_key] = true described_class.new(app, env, message, force_key).call(env) env[:result].should be end it "should ask if force is not true" do force_key = :tubes env[force_key] = false env[:ui].should_receive(:ask).with(message).and_return("nope") described_class.new(app, env, message).call(env) env[:result].should_not be end it "should set result to false if anything else is given" do env[:ui].should_receive(:ask).with(message).and_return("nope") described_class.new(app, env, message).call(env) env[:result].should_not be end end
Version data entries
19 entries across 19 versions & 6 rubygems