spec/network/ftp_spec.rb in ronin-support-0.5.1 vs spec/network/ftp_spec.rb in ronin-support-0.5.2

- old
+ new

@@ -7,47 +7,47 @@ obj = Object.new obj.extend described_class obj end - let(:host) { 'ftp.kernel.org' } + let(:host) { 'ftp.osuosl.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) + expect(ftp).to 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 + expect(ftp).not_to 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 + expect(ftp.passive).to be(true) ftp.close end it "should allow disabling passive mode" do ftp = subject.ftp_connect(host, :passive => false) - ftp.passive.should be_false + expect(ftp.passive).to 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) + expect(ftp).to be_kind_of(Net::FTP) end ftp.close end end @@ -59,11 +59,11 @@ subject.ftp_session(host) do |ftp| yielded_ftp = ftp end - yielded_ftp.should be_kind_of(Net::FTP) + expect(yielded_ftp).to be_kind_of(Net::FTP) end it "should close the FTP session after yielding it" do session = nil was_open = nil @@ -71,11 +71,11 @@ subject.ftp_session(host) do |ftp| session = ftp was_open = !ftp.closed? end - was_open.should == true - session.should be_closed + expect(was_open).to be(true) + expect(session).to be_closed end end end end