spec/lib/metasploit/model/spec_spec.rb in metasploit-model-0.30.0-java vs spec/lib/metasploit/model/spec_spec.rb in metasploit-model-0.30.1.pre.rspec.pre.3.pre.1
- old
+ new
@@ -1,8 +1,6 @@
-require 'spec_helper'
-
-describe Metasploit::Model::Spec do
+RSpec.describe Metasploit::Model::Spec do
before(:each) do
@before_temporary_pathname = described_class.send(:remove_instance_variable, :@temporary_pathname)
end
after(:each) do
@@ -33,15 +31,15 @@
f.puts 'Child File'
end
end
it 'should remove file tree' do
- pathname.exist?.should be_true
+ expect(pathname.exist?).to eq(true)
remove_temporary_pathname
- pathname.exist?.should be_false
+ expect(pathname.exist?).to eq(false)
end
end
context 'that does not exist' do
it 'should not raise an error' do
@@ -80,11 +78,11 @@
temporary_pathname
}.to_not raise_error
end
it 'should return set pathname' do
- temporary_pathname.should == pathname
+ expect(temporary_pathname).to eq(pathname)
end
end
context 'without @temporary_pathname defined' do
it 'should raise Metasploit::Model::Spec::Error' do
@@ -105,10 +103,14 @@
it 'should set @temporary_pathname' do
expect {
described_class.temporary_pathname = temporary_pathname
}.to change {
- described_class.instance_variable_get(:@temporary_pathname)
+ if described_class.instance_variable_defined? :@temporary_pathname
+ described_class.instance_variable_get(:@temporary_pathname)
+ else
+ nil
+ end
}.to(temporary_pathname)
end
end
end
\ No newline at end of file