File: test_base.rb

package info (click to toggle)
ruby-net-sftp 1%3A4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 684 kB
  • sloc: ruby: 5,136; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (8)
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
require 'common'
require 'protocol/01/test_base'

class Protocol::V02::TestBase < Protocol::V01::TestBase
  def test_version
    assert_equal 2, @base.version
  end

  undef test_rename_should_raise_not_implemented_error

  def test_rename_should_send_rename_packet
    @session.expects(:send_packet).with(FXP_RENAME, :long, 0, :string, "/old/file", :string, "/new/file")
    assert_equal 0, @base.rename("/old/file", "/new/file")
  end

  def test_rename_should_ignore_flags_parameter
    @session.expects(:send_packet).with(FXP_RENAME, :long, 0, :string, "/old/file", :string, "/new/file")
    assert_equal 0, @base.rename("/old/file", "/new/file", 1234)
  end

  private

    def driver
      Net::SFTP::Protocol::V02::Base
    end
end