spec/context_spec.rb in ffi-rxs-1.1.0 vs spec/context_spec.rb in ffi-rxs-1.2.0
- old
+ new
@@ -1,6 +1,6 @@
-$: << "." # added for ruby 1.9.2 compatibilty; it doesn't include the current directory on the load path anymore
+# encoding: utf-8
require File.join(File.dirname(__FILE__), %w[spec_helper])
module XS
@@ -57,33 +57,30 @@
end # context initializing
context "when setting context options" do
include APIHelper
- it "gets EINVAL when option name is not recognized" do
+ it "should return unsuccessful code when option name is not recognized" do
ctx = Context.new
rc = ctx.setctxopt(XS::IDENTITY, 10)
Util.resultcode_ok?(rc).should be_false
- XS::Util.errno.should == XS::EINVAL
end
end
context "when setting IO_THREADS context option" do
include APIHelper
it "should return unsuccessful code for zero io threads" do
ctx = Context.new
rc = ctx.setctxopt(XS::IO_THREADS, 0)
Util.resultcode_ok?(rc).should be_false
- XS::Util.errno.should == XS::EINVAL
end
it "should return unsuccessful code for negative io threads" do
ctx = Context.new
rc = ctx.setctxopt(XS::IO_THREADS, -1)
Util.resultcode_ok?(rc).should be_false
- XS::Util.errno.should == XS::EINVAL
end
it "should return successful code for positive io threads" do
ctx = Context.new
rc = ctx.setctxopt(XS::IO_THREADS, 10)
@@ -103,10 +100,9 @@
it "should return unsuccessful code for negative max sockets" do
ctx = Context.new
rc = ctx.setctxopt(XS::MAX_SOCKETS, -1)
Util.resultcode_ok?(rc).should be_false
- XS::Util.errno.should == XS::EINVAL
end
it "should return successful code for positive max sockets" do
ctx = Context.new
rc = ctx.setctxopt(XS::MAX_SOCKETS, 100)