spec/lib/metasploit/model/search/with_spec.rb in metasploit-model-0.30.2-java vs spec/lib/metasploit/model/search/with_spec.rb in metasploit-model-1.0.0.pre.rails.pre.4.0
- old
+ new
@@ -1,6 +1,8 @@
-RSpec.describe Metasploit::Model::Search::With do
+require 'spec_helper'
+
+describe Metasploit::Model::Search::With do
let(:base_class) do
described_class = self.described_class
Class.new do
include described_class
@@ -33,47 +35,47 @@
:new => operator
)
end
it 'should pass given options to operator_class.new' do
- expect(operator_class).to receive(:new).with(
+ operator_class.should_receive(:new).with(
hash_including(options)
).and_return(operator)
search_with_operator
end
it 'should merge :klass into options passed to operator.new' do
- expect(operator_class).to receive(:new).with(
+ operator_class.should_receive(:new).with(
hash_including(
:klass => base_class
)
)
search_with_operator
end
it 'should validate operator' do
- allow(operator_class).to receive(:new).and_return(operator)
+ operator_class.stub(:new).and_return(operator)
- expect(operator).to receive(:valid!)
+ operator.should_receive(:valid!)
search_with_operator
end
it 'should add operator to search_with_operator_by_name' do
search_with_operator
- expect(base_class.search_with_operator_by_name[operator.name]).to eq(operator)
+ base_class.search_with_operator_by_name[operator.name].should == operator
end
end
context 'search_with_operator_by_name' do
subject(:search_with_operator_by_name) do
base_class.search_with_operator_by_name
end
it 'should default to empty Hash' do
- expect(search_with_operator_by_name).to eq({})
+ search_with_operator_by_name.should == {}
end
end
end
\ No newline at end of file