summaryrefslogtreecommitdiff
path: root/spec/ruby/core/process/getrlimit_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/process/getrlimit_spec.rb')
-rw-r--r--spec/ruby/core/process/getrlimit_spec.rb23
1 files changed, 16 insertions, 7 deletions
diff --git a/spec/ruby/core/process/getrlimit_spec.rb b/spec/ruby/core/process/getrlimit_spec.rb
index f77a61a475..d36d8c3335 100644
--- a/spec/ruby/core/process/getrlimit_spec.rb
+++ b/spec/ruby/core/process/getrlimit_spec.rb
@@ -11,13 +11,13 @@ platform_is :aix do
Process.getrlimit(:DATA)
end
-platform_is_not :windows do
- describe "Process.getrlimit" do
+describe "Process.getrlimit" do
+ platform_is_not :windows do
it "returns a two-element Array of Integers" do
result = Process.getrlimit Process::RLIMIT_CORE
result.size.should == 2
- result.first.should be_kind_of(Integer)
- result.last.should be_kind_of(Integer)
+ result.first.should.is_a?(Integer)
+ result.last.should.is_a?(Integer)
end
context "when passed an Object" do
@@ -36,7 +36,7 @@ platform_is_not :windows do
obj = mock("process getrlimit integer")
obj.should_receive(:to_int).and_return(nil)
- -> { Process.getrlimit(obj) }.should raise_error(TypeError)
+ -> { Process.getrlimit(obj) }.should.raise(TypeError)
end
end
@@ -49,7 +49,7 @@ platform_is_not :windows do
end
it "raises ArgumentError when passed an unknown resource" do
- -> { Process.getrlimit(:FOO) }.should raise_error(ArgumentError)
+ -> { Process.getrlimit(:FOO) }.should.raise(ArgumentError)
end
end
@@ -62,7 +62,7 @@ platform_is_not :windows do
end
it "raises ArgumentError when passed an unknown resource" do
- -> { Process.getrlimit("FOO") }.should raise_error(ArgumentError)
+ -> { Process.getrlimit("FOO") }.should.raise(ArgumentError)
end
end
@@ -88,4 +88,13 @@ platform_is_not :windows do
end
end
end
+
+ platform_is :windows do
+ it "is not implemented" do
+ Process.respond_to?(:getrlimit).should == false
+ -> do
+ Process.getrlimit(nil)
+ end.should.raise NotImplementedError
+ end
+ end
end