Sha256: 6cb0a4df818743554eaac7cd8dc10a53fbc94617f309c0066ad78634b4ca2831
Contents?: true
Size: 1.74 KB
Versions: 1
Compression:
Stored size: 1.74 KB
Contents
require 'spec_helper' require 'ronin/network/ftp' describe Network::FTP do describe "helpers", :network do subject do obj = Object.new obj.extend described_class obj end let(:host) { 'ftp.kernel.org' } describe "#ftp_connect" do it "should return a Net::FTP object" do ftp = subject.ftp_connect(host) ftp.should be_kind_of(Net::FTP) ftp.close end it "should connect to an FTP service" do ftp = subject.ftp_connect(host) ftp.should_not be_closed ftp.close end describe ":passive" do it "should set passive mode by default" do ftp = subject.ftp_connect(host) ftp.passive.should be_true ftp.close end it "should allow disabling passive mode" do ftp = subject.ftp_connect(host, :passive => false) ftp.passive.should be_false ftp.close end end context "when given a block" do it "should yield the new Net::FTP object" do ftp = subject.ftp_connect(host) do |ftp| ftp.should be_kind_of(Net::FTP) end ftp.close end end end describe "#ftp_session" do it "should yield a new Net::FTP object" do yielded_ftp = nil subject.ftp_session(host) do |ftp| yielded_ftp = ftp end yielded_ftp.should be_kind_of(Net::FTP) end it "should close the FTP session after yielding it" do session = nil was_open = nil subject.ftp_session(host) do |ftp| session = ftp was_open = !ftp.closed? end was_open.should == true session.should be_closed end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ronin-support-0.5.1 | spec/network/ftp_spec.rb |