Sha256: 0e18fa3cdd2387d5dfa82ae524235e0288fdcbc0abbed3fd3ee13eb4f29a1d0e
Contents?: true
Size: 1.23 KB
Versions: 38
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' describe Metasploit::Model::Spec::PathnameCollision do let(:pathname) do Metasploit::Model::Spec.temporary_pathname.join('pathname') end subject(:pathname_collision) do described_class.new(pathname) end it { should be_a Metasploit::Model::Spec::Error } context 'check!' do subject(:check!) do described_class.check!(pathname) end context 'with existing Pathname' do before(:each) do pathname.mkpath end it 'should raise Metasploit::Model::Spec::PathnameCollision' do expect { check! }.to raise_error(described_class) end end context 'without existing Pathname' do it 'should not raise error' do expect { check! }.to_not raise_error end end end context '#initialize' do context '#message' do subject(:message) do pathname_collision.message end it 'should include pathname' do message.should include("#{pathname} already exists.") end it 'should include potential cause' do message.should include('Metasploit::Model::Spec.remove_temporary_pathname was not called after the previous spec.') end end end end
Version data entries
38 entries across 38 versions & 1 rubygems