spec/lib/metasploit/credential/importer/zip_spec.rb in metasploit-credential-0.14.7 vs spec/lib/metasploit/credential/importer/zip_spec.rb in metasploit-credential-0.14.8

- old
+ new

@@ -1,17 +1,19 @@ -RSpec.describe Metasploit::Credential::Importer::Zip do +require 'spec_helper' + +describe Metasploit::Credential::Importer::Zip do include_context 'Mdm::Workspace' include_context 'metasploit_credential_importer_zip_file' let(:workspace){FactoryGirl.create(:mdm_workspace)} subject(:zip_importer){ FactoryGirl.build :metasploit_credential_importer_zip, workspace: workspace } describe "validations" do DUMMY_ZIP_PATH = "/tmp/import-test-dummy.zip" context "when the zip file contains a keys directory and a manifest CSV" do - it { is_expected.to be_valid } + it { should be_valid } end context "when the zip file is not actually an archive" do let(:error) do I18n.translate!('activemodel.errors.models.metasploit/credential/importer/zip.attributes.input.malformed_archive') @@ -28,11 +30,11 @@ it { should_not be_valid } it 'should show the proper error message' do zip_importer.valid? - expect(zip_importer.errors[:input]).to include error + zip_importer.errors[:input].should include error end end context "when the zip file does not contain a manifest CSV" do let(:error) do @@ -45,11 +47,11 @@ it { should_not be_valid } it 'should show the proper error message' do zip_importer.valid? - expect(zip_importer.errors[:input]).to include error + zip_importer.errors[:input].should include error end end end @@ -59,9 +61,9 @@ end end describe "zip constants" do it 'should have ZIP_HEADER_IDENTIFIER whose length corresponds to ZIP_HEADER_BYTE_LENGTH' do - expect(Metasploit::Credential::Importer::Zip::ZIP_HEADER_IDENTIFIER.size).to eq(Metasploit::Credential::Importer::Zip::ZIP_HEADER_BYTE_LENGTH) + Metasploit::Credential::Importer::Zip::ZIP_HEADER_IDENTIFIER.size.should == Metasploit::Credential::Importer::Zip::ZIP_HEADER_BYTE_LENGTH end end end \ No newline at end of file