diff options
Diffstat (limited to 'spec/ruby/library/socket/option/bool_spec.rb')
| -rw-r--r-- | spec/ruby/library/socket/option/bool_spec.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/ruby/library/socket/option/bool_spec.rb b/spec/ruby/library/socket/option/bool_spec.rb index 74c832a0ad..9992e842b3 100644 --- a/spec/ruby/library/socket/option/bool_spec.rb +++ b/spec/ruby/library/socket/option/bool_spec.rb @@ -1,10 +1,10 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require File.expand_path('../../fixtures/classes', __FILE__) +require_relative '../spec_helper' +require_relative '../fixtures/classes' describe "Socket::Option.bool" do it "creates a new Socket::Option" do so = Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true) - so.should be_an_instance_of(Socket::Option) + so.should.instance_of?(Socket::Option) so.family.should == Socket::AF_INET so.level.should == Socket::SOL_SOCKET so.optname.should == Socket::SO_KEEPALIVE @@ -18,8 +18,10 @@ describe "Socket::Option#bool" do Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, false).bool.should == false end - it "raises TypeError if option has not good size" do - so = Socket::Option.new(:UNSPEC, :SOCKET, :SO_LINGER, [0, 0].pack('i*')) - lambda { so.bool }.should raise_error(TypeError) + platform_is_not :windows do + it 'raises TypeError when called on a non boolean option' do + opt = Socket::Option.linger(1, 4) + -> { opt.bool }.should.raise(TypeError) + end end end |
