Skip to content

Commit

Permalink
change => to is
Browse files Browse the repository at this point in the history
  • Loading branch information
tak1n committed Oct 10, 2015
1 parent cbe875e commit 29674df
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions spec/ruby/shared/process/spawn.rb
Expand Up @@ -229,19 +229,19 @@
end.should output_to_fd(Process.getpgid(Process.pid).to_s)
end

it "joins the current process if :pgroup => false" do
it "joins the current process if :pgroup is false" do
lambda do
Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => false)
end.should output_to_fd(Process.getpgid(Process.pid).to_s)
end

it "joins the current process if :pgroup => nil" do
it "joins the current process if :pgroup is nil" do
lambda do
Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => nil)
end.should output_to_fd(Process.getpgid(Process.pid).to_s)
end

it "joins a new process group if :pgroup => true" do
it "joins a new process group if :pgroup is true" do
process = lambda do
Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => true)
end
Expand All @@ -250,7 +250,7 @@
process.should output_to_fd(/\d+/)
end

it "joins a new process group if :pgroup => 0" do
it "joins a new process group if :pgroup is 0" do
process = lambda do
Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => 0)
end
Expand All @@ -259,7 +259,7 @@
process.should output_to_fd(/\d+/)
end

it "joins the specified process group if :pgroup => pgid" do
it "joins the specified process group if :pgroup is pgid" do
lambda do
Process.wait @object.spawn(ruby_cmd("print Process.getpgid(Process.pid)"), :pgroup => 123)
end.should_not output_to_fd("123")
Expand Down Expand Up @@ -334,49 +334,49 @@

# redirection

it "redirects STDOUT to the given file descriptior if :out => Fixnum" do
it "redirects STDOUT to the given file descriptior if :out is Fixnum" do
File.open(@name, 'w') do |file|
lambda do
Process.wait @object.spawn(ruby_cmd("print :glark"), :out => file.fileno)
end.should output_to_fd("glark", file)
end
end

it "redirects STDOUT to the given file if :out => IO" do
it "redirects STDOUT to the given file if :out is IO" do
File.open(@name, 'w') do |file|
lambda do
Process.wait @object.spawn(ruby_cmd("print :glark"), :out => file)
end.should output_to_fd("glark", file)
end
end

it "redirects STDOUT to the given file if :out => String" do
it "redirects STDOUT to the given file if :out is String" do
Process.wait @object.spawn(ruby_cmd("print :glark"), :out => @name)
@name.should have_data("glark")
end

it "redirects STDERR to the given file descriptior if :err => Fixnum" do
it "redirects STDERR to the given file descriptior if :err is Fixnum" do
File.open(@name, 'w') do |file|
lambda do
Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :err => file.fileno)
end.should output_to_fd("glark", file)
end
end

it "redirects STDERR to the given file descriptor if :err => IO" do
it "redirects STDERR to the given file descriptor if :err is IO" do
File.open(@name, 'w') do |file|
lambda do
Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :err => file)
end.should output_to_fd("glark", file)
end
end

it "redirects STDERR to the given file if :err => String" do
it "redirects STDERR to the given file if :err is String" do
Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :err => @name)
@name.should have_data("glark")
end

it "redirects STDERR to child STDOUT if :err => [:child, :out]" do
it "redirects STDERR to child STDOUT if :err is [:child, :out]" do
File.open(@name, 'w') do |file|
lambda do
Process.wait @object.spawn(ruby_cmd("STDERR.print :glark"), :out => file, :err => [:child, :out])
Expand Down Expand Up @@ -410,7 +410,7 @@
@name.should have_data("")
end

context "when passed :close_others => true" do
context "when passed :close_others is true" do
before :each do
@output = tmp("spawn_close_others_true")
@options = { :close_others => true }
Expand Down Expand Up @@ -453,7 +453,7 @@
end
end

context "when passed :close_others => false" do
context "when passed :close_others is false" do
before :each do
@output = tmp("spawn_close_others_false")
@options = { :close_others => false }
Expand Down

0 comments on commit 29674df

Please sign in to comment.