spec/app/models/metasploit/model/search/operator/association_spec.rb in metasploit-model-0.30.0-java vs spec/app/models/metasploit/model/search/operator/association_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::Operator::Association do
+RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
subject(:operator) do
described_class.new(
:association => association,
:source_operator => source_operator
)
@@ -14,15 +12,15 @@
let(:source_operator) do
double('Metasploit::Model::Search::Operator::Base')
end
- it { should be_a Metasploit::Model::Search::Operator::Base }
+ it { is_expected.to be_a Metasploit::Model::Search::Operator::Base }
context 'validations' do
- it { should validate_presence_of(:association) }
- it { should validate_presence_of(:source_operator) }
+ it { is_expected.to validate_presence_of(:association) }
+ it { is_expected.to validate_presence_of(:source_operator) }
end
context '#help' do
subject(:help) do
operator.help
@@ -49,11 +47,11 @@
let(:source_operator_name) {
'source_operator_name'
}
- it { should be_a Symbol }
+ it { is_expected.to be_a Symbol }
it 'should be <association>.<source_operator.name>' do
expect(name).to eq :"#{association}.#{source_operator_name}"
end
end
@@ -79,10 +77,10 @@
super().tap { |source_operator|
expect(source_operator).to receive(:operate_on).with(formatted_value).and_return(expected_source_operation)
}
}
- it { should be_a Metasploit::Model::Search::Operation::Association }
+ it { is_expected.to be_a Metasploit::Model::Search::Operation::Association }
context 'Metasploit::Model::Search::Operation::Association' do
context '#operator' do
subject(:operation_operator) {
operate_on.operator
\ No newline at end of file