Sha256: a11a42c38b987b72c652f51803c4e5d9fa9f5683d204bf95682a0e7cb2a5cfa2

Contents?: true

Size: 927 Bytes

Versions: 8

Compression:

Stored size: 927 Bytes

Contents

require 'spec_helper'

describe Metasploit::Credential::Importer::Multi do
  include_context 'Mdm::Workspace'
  include_context 'metasploit_credential_importer_zip_file'

  UNSUPPORTED_FILE = 'bad.txt'

  let(:import_origin){ FactoryGirl.create :metasploit_credential_origin_import }

  describe "validation" do
    describe "when given a file that is not a zip or a CSV" do
      let(:unsupported_file){ File.open("#{Dir.tmpdir}/#{UNSUPPORTED_FILE}", 'wb') }
      subject(:multi_importer){ Metasploit::Credential::Importer::Multi.new(input: unsupported_file, origin: import_origin)}

      it { should_not be_valid }
    end

    context "when given zip file" do
      let(:supported_file){ FactoryGirl.generate :metasploit_credential_importer_zip_file }
      subject(:multi_importer){ Metasploit::Credential::Importer::Multi.new(input: supported_file, origin: import_origin)}

      it { should be_valid }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metasploit-credential-0.7.11-java spec/lib/metasploit/credential/importer/multi_spec.rb
metasploit-credential-0.7.11 spec/lib/metasploit/credential/importer/multi_spec.rb
metasploit-credential-0.7.10-java spec/lib/metasploit/credential/importer/multi_spec.rb
metasploit-credential-0.7.10 spec/lib/metasploit/credential/importer/multi_spec.rb
metasploit-credential-0.7.10.pre.core.pre.search spec/lib/metasploit/credential/importer/multi_spec.rb
metasploit-credential-0.7.9.pre.core.pre.search spec/lib/metasploit/credential/importer/multi_spec.rb
metasploit-credential-0.7.8 spec/lib/metasploit/credential/importer/multi_spec.rb
metasploit-credential-0.7.8-java spec/lib/metasploit/credential/importer/multi_spec.rb