Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed formatting and descriptions for Kernel#exec specs.

  • Loading branch information...
commit 8dc7d524d7bd26f0f1bdf47e9bcc08ea48c51d18 1 parent 3f9d5df
@brixen brixen authored
Showing with 19 additions and 13 deletions.
  1. +19 −13 core/kernel/exec_spec.rb
View
32 core/kernel/exec_spec.rb
@@ -18,19 +18,6 @@
lambda { exec "bogus-noent-script.sh" }.should raise_error(Errno::ENOENT)
end
- describe "raises Errno::EACCES" do
- before { @script = tmp("tmp.sh"); touch @script }
- after { rm_r @script }
-
- it "when executing a file with improper permissions" do
- lambda { exec @script }.should raise_error(Errno::EACCES)
- end
-
- it "when executing a directory" do
- lambda { exec File.dirname(@script) }.should raise_error(Errno::EACCES)
- end
- end
-
it "runs the specified command, replacing current process" do
result = `#{RUBY_EXE} -e 'exec "echo hello"; puts "fail"'`
result.should == "hello\n"
@@ -44,6 +31,25 @@
end
end
+describe "Kernel#exec" do
+ before :each do
+ @script = tmp("tmp.sh")
+ touch @script
+ end
+
+ after :each do
+ rm_r @script
+ end
+
+ it "raises Errno::EACCES when the file does not have execute permissions" do
+ lambda { exec @script }.should raise_error(Errno::EACCES)
+ end
+
+ it "raises Errno::ACCES when passed a directory" do
+ lambda { exec File.dirname(@script) }.should raise_error(Errno::EACCES)
+ end
+end
+
describe "Kernel.exec" do
it "needs to be reviewed for spec completeness"
end
Please sign in to comment.
Something went wrong with that request. Please try again.