metasploit-model 0.30.2 → 1.0.0.pre.rails.pre.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +4 -2
  3. data/CONTRIBUTING.md +49 -9
  4. data/Gemfile +8 -3
  5. data/lib/metasploit/model.rb +5 -0
  6. data/lib/metasploit/model/engine.rb +1 -1
  7. data/lib/metasploit/model/version.rb +14 -26
  8. data/metasploit-model.gemspec +5 -3
  9. data/spec/app/models/metasploit/model/association/reflection_spec.rb +7 -5
  10. data/spec/app/models/metasploit/model/search/group/base_spec.rb +4 -2
  11. data/spec/app/models/metasploit/model/search/group/intersection_spec.rb +4 -2
  12. data/spec/app/models/metasploit/model/search/group/union_spec.rb +4 -2
  13. data/spec/app/models/metasploit/model/search/operation/association_spec.rb +9 -7
  14. data/spec/app/models/metasploit/model/search/operation/base_spec.rb +7 -5
  15. data/spec/app/models/metasploit/model/search/operation/boolean_spec.rb +11 -14
  16. data/spec/app/models/metasploit/model/search/operation/date_spec.rb +8 -6
  17. data/spec/app/models/metasploit/model/search/operation/group/base_spec.rb +14 -12
  18. data/spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb +4 -2
  19. data/spec/app/models/metasploit/model/search/operation/group/union_spec.rb +4 -2
  20. data/spec/app/models/metasploit/model/search/operation/integer_spec.rb +4 -2
  21. data/spec/app/models/metasploit/model/search/operation/null_spec.rb +6 -4
  22. data/spec/app/models/metasploit/model/search/operation/set/integer_spec.rb +4 -2
  23. data/spec/app/models/metasploit/model/search/operation/set/string_spec.rb +4 -2
  24. data/spec/app/models/metasploit/model/search/operation/set_spec.rb +6 -4
  25. data/spec/app/models/metasploit/model/search/operation/string_spec.rb +4 -2
  26. data/spec/app/models/metasploit/model/search/operator/association_spec.rb +8 -6
  27. data/spec/app/models/metasploit/model/search/operator/attribute_spec.rb +14 -12
  28. data/spec/app/models/metasploit/model/search/operator/base_spec.rb +5 -3
  29. data/spec/app/models/metasploit/model/search/operator/delegation_spec.rb +11 -13
  30. data/spec/app/models/metasploit/model/search/operator/group/base_spec.rb +7 -5
  31. data/spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb +5 -3
  32. data/spec/app/models/metasploit/model/search/operator/group/union_spec.rb +5 -3
  33. data/spec/app/models/metasploit/model/search/operator/null_spec.rb +7 -5
  34. data/spec/app/models/metasploit/model/search/operator/single_spec.rb +28 -26
  35. data/spec/app/models/metasploit/model/search/query_spec.rb +50 -48
  36. data/spec/app/models/metasploit/model/visitation/visitor_spec.rb +9 -7
  37. data/spec/app/validators/ip_format_validator_spec.rb +9 -7
  38. data/spec/app/validators/nil_validator_spec.rb +5 -3
  39. data/spec/app/validators/parameters_validator_spec.rb +29 -29
  40. data/spec/app/validators/password_is_strong_validator_spec.rb +19 -17
  41. data/spec/dummy/config/application.rb +3 -1
  42. data/spec/dummy/config/environments/development.rb +0 -3
  43. data/spec/lib/metasploit/model/association/error_spec.rb +3 -1
  44. data/spec/lib/metasploit/model/association_spec.rb +10 -8
  45. data/spec/lib/metasploit/model/base_spec.rb +5 -3
  46. data/spec/lib/metasploit/model/engine_spec.rb +11 -48
  47. data/spec/lib/metasploit/model/file_spec.rb +5 -3
  48. data/spec/lib/metasploit/model/invalid_spec.rb +9 -7
  49. data/spec/lib/metasploit/model/login/status_spec.rb +3 -1
  50. data/spec/lib/metasploit/model/nilify_blanks_spec.rb +13 -11
  51. data/spec/lib/metasploit/model/realm/key_spec.rb +17 -15
  52. data/spec/lib/metasploit/model/search/association/tree_spec.rb +5 -3
  53. data/spec/lib/metasploit/model/search/association_spec.rb +4 -2
  54. data/spec/lib/metasploit/model/search/attribute_spec.rb +8 -6
  55. data/spec/lib/metasploit/model/search/operation/value/integer_spec.rb +3 -1
  56. data/spec/lib/metasploit/model/search/operation/value/string_spec.rb +3 -1
  57. data/spec/lib/metasploit/model/search/operation_spec.rb +13 -11
  58. data/spec/lib/metasploit/model/search/operator/help_spec.rb +3 -1
  59. data/spec/lib/metasploit/model/search/with_spec.rb +9 -7
  60. data/spec/lib/metasploit/model/search_spec.rb +13 -11
  61. data/spec/lib/metasploit/model/spec/error_spec.rb +4 -2
  62. data/spec/lib/metasploit/model/spec/i18n_exception_handler_spec.rb +7 -5
  63. data/spec/lib/metasploit/model/spec/pathname_collision_spec.rb +6 -4
  64. data/spec/lib/metasploit/model/spec_spec.rb +7 -9
  65. data/spec/lib/metasploit/model/translation_spec.rb +12 -10
  66. data/spec/lib/metasploit/model/version_spec.rb +139 -3
  67. data/spec/lib/metasploit/model/visitation/visit_spec.rb +26 -28
  68. data/spec/matchers/validate_nilness_of_spec.rb +2 -0
  69. data/spec/spec_helper.rb +10 -80
  70. data/spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb +1 -1
  71. data/spec/support/shared/examples/metasploit/model/search/operation/value/integer.rb +8 -8
  72. data/spec/support/shared/examples/metasploit/model/search/operation/value/string.rb +5 -5
  73. data/spec/support/shared/examples/metasploit/model/search/operator/help.rb +16 -18
  74. data/spec/support/shared/examples/metasploit/model/translation.rb +4 -4
  75. data/spec/support/shared/examples/search/query.rb +3 -3
  76. data/spec/support/shared/examples/search_association.rb +2 -2
  77. data/spec/support/shared/examples/search_attribute.rb +3 -3
  78. data/spec/support/shared/examples/search_with.rb +3 -3
  79. metadata +20 -27
  80. data/CHANGELOG.md +0 -6
  81. data/RELEASING.md +0 -86
  82. data/UPGRADING.md +0 -1
  83. data/spec/lib/metasploit/model_spec.rb +0 -4
@@ -1,4 +1,6 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Date do
2
4
  context 'validation' do
3
5
  context 'value' do
4
6
  before(:each) do
@@ -23,7 +25,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
23
25
  end
24
26
 
25
27
  it 'should not record error' do
26
- expect(errors).not_to include(error)
28
+ errors.should_not include(error)
27
29
  end
28
30
  end
29
31
 
@@ -33,7 +35,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
33
35
  end
34
36
 
35
37
  it 'should record error' do
36
- expect(errors).to include(error)
38
+ errors.should include(error)
37
39
  end
38
40
  end
39
41
  end
@@ -54,7 +56,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
54
56
  end
55
57
 
56
58
  it 'should be passed in Date' do
57
- expect(value).to eq(formatted_value)
59
+ value.should == formatted_value
58
60
  end
59
61
  end
60
62
 
@@ -69,7 +71,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
69
71
  end
70
72
 
71
73
  it 'should be parsed Date' do
72
- expect(value).to eq(date)
74
+ value.should == date
73
75
  end
74
76
  end
75
77
 
@@ -79,7 +81,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
79
81
  end
80
82
 
81
83
  it 'should pass through value' do
82
- expect(value).to be formatted_value
84
+ value.should be formatted_value
83
85
  end
84
86
  end
85
87
  end
@@ -1,13 +1,15 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Group::Base do
2
4
  subject(:group) do
3
5
  described_class.new
4
6
  end
5
7
 
6
- it { is_expected.to be_a Metasploit::Model::Search::Operation::Base }
8
+ it { should be_a Metasploit::Model::Search::Operation::Base }
7
9
 
8
10
  context 'validations' do
9
11
  context 'children' do
10
- it { is_expected.to ensure_length_of(:children).is_at_least(1).with_short_message('is too short (minimum is 1 child)') }
12
+ it { should ensure_length_of(:children).is_at_least(1).with_short_message('is too short (minimum is 1 child)') }
11
13
 
12
14
  context '#children_valid' do
13
15
  subject(:children_valid) do
@@ -46,25 +48,25 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
46
48
  context 'with all valid' do
47
49
  before(:each) do
48
50
  children.each do |child|
49
- allow(child).to receive(:valid?).and_return(true)
51
+ child.stub(valid?: true)
50
52
  end
51
53
  end
52
54
 
53
55
  it 'does not add error on :children' do
54
56
  group.valid?
55
57
 
56
- expect(group.errors[:children]).not_to include(error)
58
+ group.errors[:children].should_not include(error)
57
59
  end
58
60
  end
59
61
 
60
62
  context 'with later valid' do
61
63
  before(:each) do
62
- allow(children.first).to receive(:valid?).and_return(false)
63
- allow(children.second).to receive(:valid?).and_return(true)
64
+ children.first.stub(valid?: false)
65
+ children.second.stub(valid?: true)
64
66
  end
65
67
 
66
68
  it 'does not short-circuit and validates all children' do
67
- expect(children.second).to receive(:valid?).and_return(true)
69
+ children.second.should_receive(:valid?).and_return(true)
68
70
 
69
71
  children_valid
70
72
  end
@@ -72,7 +74,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
72
74
  it 'should add error on :children' do
73
75
  group.valid?
74
76
 
75
- expect(group.errors[:children]).to include(error)
77
+ group.errors[:children].should include(error)
76
78
  end
77
79
  end
78
80
  end
@@ -85,7 +87,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
85
87
  it 'does not add error on :children' do
86
88
  group.valid?
87
89
 
88
- expect(group.errors[:children]).not_to include(error)
90
+ group.errors[:children].should_not include(error)
89
91
  end
90
92
  end
91
93
  end
@@ -98,7 +100,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
98
100
  end
99
101
 
100
102
  context 'default' do
101
- it { is_expected.to eq([]) }
103
+ it { should == [] }
102
104
  end
103
105
 
104
106
  context 'with attribute' do
@@ -115,7 +117,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
115
117
  end
116
118
 
117
119
  it 'is the value passed with :children to #new' do
118
- expect(children).to eq(expected_children)
120
+ children.should == expected_children
119
121
  end
120
122
  end
121
123
  end
@@ -1,3 +1,5 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Group::Intersection, type: :model do
2
- it { is_expected.to be_a Metasploit::Model::Search::Operation::Group::Base }
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Group::Intersection do
4
+ it { should be_a Metasploit::Model::Search::Operation::Group::Base }
3
5
  end
@@ -1,3 +1,5 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Group::Union, type: :model do
2
- it { is_expected.to be_a Metasploit::Model::Search::Operation::Group::Base }
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Group::Union do
4
+ it { should be_a Metasploit::Model::Search::Operation::Group::Base }
3
5
  end
@@ -1,6 +1,8 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Integer, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Integer do
2
4
  context 'validation' do
3
- it { is_expected.to validate_numericality_of(:value).only_integer }
5
+ it { should validate_numericality_of(:value).only_integer }
4
6
  end
5
7
 
6
8
  it_should_behave_like 'Metasploit::Model::Search::Operation::Value::Integer'
@@ -1,4 +1,6 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Null, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Null do
2
4
  context 'validation' do
3
5
  context 'operator' do
4
6
  context 'null' do
@@ -39,7 +41,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Null, type: :model do
39
41
  end
40
42
 
41
43
  it 'should not record error' do
42
- expect(errors).not_to include(error)
44
+ errors.should_not include(error)
43
45
  end
44
46
  end
45
47
 
@@ -49,11 +51,11 @@ RSpec.describe Metasploit::Model::Search::Operation::Null, type: :model do
49
51
  end
50
52
 
51
53
  it 'should record error' do
52
- expect(errors).to include(error)
54
+ errors.should include(error)
53
55
  end
54
56
 
55
57
  it 'should have no other errors, so that it would be valid without this type check on operator' do
56
- expect(operation.errors.size).to eq(1)
58
+ operation.errors.size.should == 1
57
59
  end
58
60
  end
59
61
  end
@@ -1,5 +1,7 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Set::Integer, type: :model do
2
- it { is_expected.to be_a Metasploit::Model::Search::Operation::Set }
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Set::Integer do
4
+ it { should be_a Metasploit::Model::Search::Operation::Set }
3
5
 
4
6
  it_should_behave_like 'Metasploit::Model::Search::Operation::Value::Integer'
5
7
  end
@@ -1,5 +1,7 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Set::String, type: :model do
2
- it { is_expected.to be_a Metasploit::Model::Search::Operation::Set }
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Set::String do
4
+ it { should be_a Metasploit::Model::Search::Operation::Set }
3
5
 
4
6
  it_should_behave_like 'Metasploit::Model::Search::Operation::Value::String'
5
7
  end
@@ -1,4 +1,6 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::Set, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::Set do
2
4
  subject(:set) do
3
5
  described_class.new(
4
6
  operator: operator,
@@ -95,7 +97,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Set, type: :model do
95
97
  attribute_set.sample
96
98
  end
97
99
 
98
- it { is_expected.not_to include(error) }
100
+ it { should_not include(error) }
99
101
  end
100
102
 
101
103
  context 'without value in attribute_set' do
@@ -103,7 +105,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Set, type: :model do
103
105
  :not_an_member
104
106
  end
105
107
 
106
- it { is_expected.to include(error) }
108
+ it { should include(error) }
107
109
  end
108
110
  end
109
111
 
@@ -116,7 +118,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Set, type: :model do
116
118
  nil
117
119
  end
118
120
 
119
- it { is_expected.not_to include(error) }
121
+ it { should_not include(error) }
120
122
  end
121
123
  end
122
124
  end
@@ -1,6 +1,8 @@
1
- RSpec.describe Metasploit::Model::Search::Operation::String, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operation::String do
2
4
  context 'validation' do
3
- it { is_expected.to validate_presence_of(:value) }
5
+ it { should validate_presence_of(:value) }
4
6
  end
5
7
 
6
8
  it_should_behave_like 'Metasploit::Model::Search::Operation::Value::String'
@@ -1,4 +1,6 @@
1
- RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operator::Association do
2
4
  subject(:operator) do
3
5
  described_class.new(
4
6
  :association => association,
@@ -14,11 +16,11 @@ RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
14
16
  double('Metasploit::Model::Search::Operator::Base')
15
17
  end
16
18
 
17
- it { is_expected.to be_a Metasploit::Model::Search::Operator::Base }
19
+ it { should be_a Metasploit::Model::Search::Operator::Base }
18
20
 
19
21
  context 'validations' do
20
- it { is_expected.to validate_presence_of(:association) }
21
- it { is_expected.to validate_presence_of(:source_operator) }
22
+ it { should validate_presence_of(:association) }
23
+ it { should validate_presence_of(:source_operator) }
22
24
  end
23
25
 
24
26
  context '#help' do
@@ -49,7 +51,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
49
51
  'source_operator_name'
50
52
  }
51
53
 
52
- it { is_expected.to be_a Symbol }
54
+ it { should be_a Symbol }
53
55
 
54
56
  it 'should be <association>.<source_operator.name>' do
55
57
  expect(name).to eq :"#{association}.#{source_operator_name}"
@@ -79,7 +81,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
79
81
  }
80
82
  }
81
83
 
82
- it { is_expected.to be_a Metasploit::Model::Search::Operation::Association }
84
+ it { should be_a Metasploit::Model::Search::Operation::Association }
83
85
 
84
86
  context 'Metasploit::Model::Search::Operation::Association' do
85
87
  context '#operator' do
@@ -1,5 +1,7 @@
1
- RSpec.describe Metasploit::Model::Search::Operator::Attribute, type: :model do
2
- it { is_expected.to be_a Metasploit::Model::Search::Operator::Single }
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operator::Attribute do
4
+ it { should be_a Metasploit::Model::Search::Operator::Single }
3
5
 
4
6
  context 'CONSTANTS' do
5
7
  context 'TYPES' do
@@ -7,30 +9,30 @@ RSpec.describe Metasploit::Model::Search::Operator::Attribute, type: :model do
7
9
  described_class::TYPES
8
10
  end
9
11
 
10
- it { is_expected.to include(:boolean) }
11
- it { is_expected.to include(:date) }
12
+ it { should include(:boolean) }
13
+ it { should include(:date) }
12
14
  it {
13
- is_expected.to include(
15
+ should include(
14
16
  {
15
17
  set: :integer
16
18
  }
17
19
  )
18
20
  }
19
21
  it {
20
- is_expected.to include(
22
+ should include(
21
23
  {
22
24
  set: :string
23
25
  }
24
26
  )
25
27
  }
26
- it { is_expected.to include(:integer) }
27
- it { is_expected.to include(:string) }
28
+ it { should include(:integer) }
29
+ it { should include(:string) }
28
30
  end
29
31
  end
30
32
 
31
33
  context 'validations' do
32
- it { is_expected.to validate_presence_of(:attribute) }
33
- it { is_expected.to ensure_inclusion_of(:type).in_array(described_class::TYPES) }
34
+ it { should validate_presence_of(:attribute) }
35
+ it { should validate_inclusion_of(:type).in_array(described_class::TYPES) }
34
36
  end
35
37
 
36
38
  context '#attribute_enumerable' do
@@ -75,7 +77,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Attribute, type: :model do
75
77
  end
76
78
 
77
79
  it 'should be #klass #<attribute>_set' do
78
- expect(attribute_set).to eq(expected_attribute_set)
80
+ attribute_set.should == expected_attribute_set
79
81
  end
80
82
  end
81
83
  end
@@ -96,7 +98,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Attribute, type: :model do
96
98
  end
97
99
 
98
100
  it 'should be #attribute' do
99
- expect(name).to eq(attribute)
101
+ name.should == attribute
100
102
  end
101
103
  end
102
104
  end
@@ -1,4 +1,6 @@
1
- RSpec.describe Metasploit::Model::Search::Operator::Base, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operator::Base do
2
4
  subject(:operator) do
3
5
  described_class.new
4
6
  end
@@ -10,12 +12,12 @@ RSpec.describe Metasploit::Model::Search::Operator::Base, type: :model do
10
12
 
11
13
  before(:each) do
12
14
  # have to stub since it's not implemented on base
13
- allow(operator).to receive(:name).and_return(name)
15
+ operator.stub(name: name)
14
16
  end
15
17
  end
16
18
 
17
19
  context 'validations' do
18
- it { is_expected.to validate_presence_of(:klass) }
20
+ it { should validate_presence_of(:klass) }
19
21
  end
20
22
 
21
23
  context '#name' do
@@ -1,4 +1,6 @@
1
- RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
1
+ require 'spec_helper'
2
+
3
+ describe Metasploit::Model::Search::Operator::Delegation do
2
4
  subject(:operator) do
3
5
  described_class.new(
4
6
  :klass => klass
@@ -9,7 +11,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
9
11
  Class.new
10
12
  end
11
13
 
12
- it { is_expected.to be_a Metasploit::Model::Search::Operator::Base }
14
+ it { should be_a Metasploit::Model::Search::Operator::Base }
13
15
 
14
16
  context 'operator_name' do
15
17
  subject(:operator_name) do
@@ -30,7 +32,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
30
32
  end
31
33
 
32
34
  it 'should remove namespace' do
33
- expect(operator_name).to eq(base_name.downcase.to_sym)
35
+ operator_name.should == base_name.downcase.to_sym
34
36
  end
35
37
  end
36
38
 
@@ -40,7 +42,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
40
42
  end
41
43
 
42
44
  it 'should convert name to underscore' do
43
- expect(operator_name).to eq(:camel_case)
45
+ operator_name.should == :camel_case
44
46
  end
45
47
  end
46
48
  end
@@ -65,21 +67,17 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
65
67
  end
66
68
 
67
69
  before(:each) do
68
- outer_search_operator_by_name = search_operator_by_name
69
-
70
- klass.send(:define_singleton_method, :search_operator_by_name) do
71
- outer_search_operator_by_name
72
- end
70
+ klass.stub(:search_operator_by_name => search_operator_by_name)
73
71
  end
74
72
 
75
73
  it 'should convert formatted_operator to Symbol' do
76
- expect(formatted_operator).to receive(:to_sym)
74
+ formatted_operator.should_receive(:to_sym)
77
75
 
78
76
  named_operator
79
77
  end
80
78
 
81
79
  it 'should look up operator name in search_operator_by_name of #klass' do
82
- expect(named_operator).to eq(search_operator)
80
+ named_operator.should == search_operator
83
81
  end
84
82
 
85
83
  context 'with name not in klass.search_operator_by_name' do
@@ -102,9 +100,9 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
102
100
 
103
101
  it 'should delegate to operator_name' do
104
102
  operator_name = double('Operator Name')
105
- allow(operator.class).to receive(:operator_name).and_return(operator_name)
103
+ operator.class.stub(:operator_name => operator_name)
106
104
 
107
- expect(name).to eq(operator_name)
105
+ name.should == operator_name
108
106
  end
109
107
  end
110
108
  end