diff options
Diffstat (limited to 'spec/ruby/library/socket/option/inspect_spec.rb')
| -rw-r--r-- | spec/ruby/library/socket/option/inspect_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/ruby/library/socket/option/inspect_spec.rb b/spec/ruby/library/socket/option/inspect_spec.rb new file mode 100644 index 0000000000..ebea940d2f --- /dev/null +++ b/spec/ruby/library/socket/option/inspect_spec.rb @@ -0,0 +1,19 @@ +require_relative '../spec_helper' +require_relative '../fixtures/classes' + + +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 |
