diff options
Diffstat (limited to 'spec/rubyspec/library/socket/option/inspect_spec.rb')
-rw-r--r-- | spec/rubyspec/library/socket/option/inspect_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/rubyspec/library/socket/option/inspect_spec.rb b/spec/rubyspec/library/socket/option/inspect_spec.rb new file mode 100644 index 0000000000..df72f227a9 --- /dev/null +++ b/spec/rubyspec/library/socket/option/inspect_spec.rb @@ -0,0 +1,20 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require File.expand_path('../../fixtures/classes', __FILE__) + +require 'socket' + +describe 'Socket::Option#inspect' do + it 'correctly returns SO_LINGER value' do + value = Socket::Option.linger(nil, 0).inspect + value.should == '#<Socket::Option: UNSPEC SOCKET LINGER off 0sec>' + + value = Socket::Option.linger(false, 30).inspect + value.should == '#<Socket::Option: UNSPEC SOCKET LINGER off 30sec>' + + value = Socket::Option.linger(true, 0).inspect + value.should == '#<Socket::Option: UNSPEC SOCKET LINGER on 0sec>' + + value = Socket::Option.linger(true, 30).inspect + value.should == '#<Socket::Option: UNSPEC SOCKET LINGER on 30sec>' + end +end |