Skip to content

Commit

Permalink
Add spec for File::Spec.pipe?
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio Castelli committed Jun 19, 2011
1 parent 9d65d35 commit 4fd0d81
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion spec/ruby/core/file/stat/pipe_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,26 @@
end

describe "File::Stat#pipe?" do
it "needs to be reviewed for spec completeness"
it "returns false if the file is not a pipe" do
filename = tmp("i_exist")
touch(filename)

st = File.stat(filename)
st.pipe?.should == false

rm_r filename
end

platform_is_not :windows do
it "returns true if the file is a pipe" do
filename = tmp("i_am_a_pipe")
system "mkfifo #{filename}"

st = File.stat(filename)
st.pipe?.should == true

rm_r filename
end
end

end

0 comments on commit 4fd0d81

Please sign in to comment.