spec/cmds/out_spec.rb in cmds-0.0.9 vs spec/cmds/out_spec.rb in cmds-0.1.0
- old
+ new
@@ -1,10 +1,10 @@
require 'spec_helper'
describe "Cmds.out" do
it "gets echo output" do
- expect( Cmds.out "echo %s", ["hey there!"] ).to eq "hey there!\n"
+ expect( Cmds.out "echo %s", "hey there!" ).to eq "hey there!\n"
end
it "reads input" do
expect(
Cmds.out("ruby -e %{script}", script: "puts STDIN.read") {
@@ -14,11 +14,11 @@
end
end # Cmds.out
describe "Cmds.out!" do
it "gets echo output" do
- expect( Cmds.out! "echo %s", ["hey there!"] ).to eq "hey there!\n"
+ expect( Cmds.out! "echo %s", "hey there!" ).to eq "hey there!\n"
end
it "reads input" do
expect(
Cmds.out!("ruby -e %{script}", script: "puts STDIN.read") {
@@ -32,34 +32,34 @@
end
end # Cmds.out!
describe "Cmds#out" do
it "gets echo output" do
- expect( Cmds.new("echo %s").out ["hey there!"] ).to eq "hey there!\n"
+ expect( Cmds::Cmd.new("echo %s").out "hey there!" ).to eq "hey there!\n"
end
it "reads input" do
expect(
- Cmds.new("ruby -e %{script}").out(script: "puts STDIN.read") {
+ Cmds::Cmd.new("ruby -e %{script}").out(script: "puts STDIN.read") {
"hey there!"
}
).to eq "hey there!\n"
end
end # Cmds#out
describe "Cmds#out!" do
it "gets echo output" do
- expect( Cmds.new("echo %s").out! ["hey there!"] ).to eq "hey there!\n"
+ expect( Cmds::Cmd.new("echo %s").out! "hey there!" ).to eq "hey there!\n"
end
it "reads input" do
expect(
- Cmds.new("ruby -e %{script}").out!(script: "puts STDIN.read") {
+ Cmds::Cmd.new("ruby -e %{script}").out!(script: "puts STDIN.read") {
"hey there!"
}
).to eq "hey there!\n"
end
it "errors when the command fails" do
- expect { Cmds.new("false").out! }.to raise_error SystemCallError
+ expect { Cmds::Cmd.new("false").out! }.to raise_error SystemCallError
end
end # Cmds#out!