spec/lib/metasploit/model/search_spec.rb in metasploit-model-0.30.0-java vs spec/lib/metasploit/model/search_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::Search do
+RSpec.describe Metasploit::Model::Search do
subject(:base_instance) do
base_class.new
end
let(:base_class) do
@@ -14,13 +12,13 @@
stub_const('Searched', base_class)
base_class.send(:include, described_class)
end
- it { should be_a Metasploit::Model::Search::Association }
- it { should be_a Metasploit::Model::Search::Attribute }
- it { should be_a Metasploit::Model::Search::With }
+ it { is_expected.to be_a Metasploit::Model::Search::Association }
+ it { is_expected.to be_a Metasploit::Model::Search::Attribute }
+ it { is_expected.to be_a Metasploit::Model::Search::With }
context 'search_operator_by_name' do
subject(:search_operator_by_name) do
base_class.search_operator_by_name
end
@@ -43,11 +41,11 @@
subject(:name) do
operator.name
end
it 'should be same as the attribute' do
- name.should == attribute
+ expect(name).to eq(attribute)
end
end
end
end
@@ -88,19 +86,19 @@
let(:expected_name) do
"#{association}.#{associated_attribute}".to_sym
end
- it { should be_a Metasploit::Model::Search::Operator::Association }
+ it { is_expected.to be_a Metasploit::Model::Search::Operator::Association }
context 'association' do
subject(:operator_association) do
operator.association
end
it 'should be the registered association' do
- operator_association.should == association
+ expect(operator_association).to eq(association)
end
end
context 'source_operator' do
subject(:source_operator) do
@@ -110,21 +108,21 @@
let(:direct_attribute_operator) do
association_class.search_operator_by_name.values.first
end
it 'should be operator from associated class' do
- source_operator.should == direct_attribute_operator
+ expect(source_operator).to eq(direct_attribute_operator)
end
end
context 'klass' do
subject(:klass) do
operator.klass
end
it 'should be class that called search_operator_by_name' do
- klass.should == base_class
+ expect(klass).to eq(base_class)
end
end
end
end
@@ -153,18 +151,18 @@
subject(:named_operator) do
search_operator_by_name[name]
end
it 'should be in search_operator_by_name' do
- named_operator.should == operator
+ expect(named_operator).to eq(operator)
end
end
end
context 'without search attribute' do
context 'without search association' do
context 'without search with' do
- it { should be_empty }
+ it { is_expected.to be_empty }
end
end
end
end
end
\ No newline at end of file