summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net/ftp/return_code_spec.rb
blob: 67fc9d3b19f72d79fd0c5e4cd95020135379957b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require_relative '../../../spec_helper'

ruby_version_is ""..."3.1" do
  require_relative 'spec_helper'

  describe "Net::FTP#return_code" do
    before :each do
      @ftp = Net::FTP.new
    end

    it "outputs a warning and returns a newline" do
      -> do
        @ftp.return_code.should == "\n"
      end.should complain(/warning: Net::FTP#return_code is obsolete and do nothing/)
    end
  end

  describe "Net::FTP#return_code=" do
    before :each do
      @ftp = Net::FTP.new
    end

    it "outputs a warning" do
      -> { @ftp.return_code = 123 }.should complain(/warning: Net::FTP#return_code= is obsolete and do nothing/)
    end
  end
end