spec/integration/dsl_spec.rb in capistrano-3.11.1 vs spec/integration/dsl_spec.rb in capistrano-3.11.2
- old
+ new
@@ -354,27 +354,29 @@
end
end
end
describe "asking for a variable" do
+ let(:stdin) { stub(tty?: true) }
+
before do
- dsl.ask(:scm, :svn)
+ dsl.ask(:scm, :svn, stdin: stdin)
$stdout.stubs(:print)
end
context "variable is provided" do
before do
- $stdin.expects(:gets).returns("git")
+ stdin.expects(:gets).returns("git")
end
it "sets the input as the variable" do
expect(dsl.fetch(:scm)).to eq "git"
end
end
context "variable is not provided" do
before do
- $stdin.expects(:gets).returns("")
+ stdin.expects(:gets).returns("")
end
it "sets the variable as the default" do
expect(dsl.fetch(:scm)).to eq :svn
end