metasploit-model 0.30.0-java → 0.30.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -4
  3. data/Gemfile +1 -6
  4. data/lib/metasploit/model/version.rb +1 -1
  5. data/spec/app/models/metasploit/model/association/reflection_spec.rb +5 -7
  6. data/spec/app/models/metasploit/model/search/group/base_spec.rb +2 -4
  7. data/spec/app/models/metasploit/model/search/group/intersection_spec.rb +2 -4
  8. data/spec/app/models/metasploit/model/search/group/union_spec.rb +2 -4
  9. data/spec/app/models/metasploit/model/search/operation/association_spec.rb +7 -9
  10. data/spec/app/models/metasploit/model/search/operation/base_spec.rb +5 -7
  11. data/spec/app/models/metasploit/model/search/operation/boolean_spec.rb +14 -11
  12. data/spec/app/models/metasploit/model/search/operation/date_spec.rb +6 -8
  13. data/spec/app/models/metasploit/model/search/operation/group/base_spec.rb +12 -14
  14. data/spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb +2 -4
  15. data/spec/app/models/metasploit/model/search/operation/group/union_spec.rb +2 -4
  16. data/spec/app/models/metasploit/model/search/operation/integer_spec.rb +2 -4
  17. data/spec/app/models/metasploit/model/search/operation/null_spec.rb +4 -6
  18. data/spec/app/models/metasploit/model/search/operation/set/integer_spec.rb +2 -4
  19. data/spec/app/models/metasploit/model/search/operation/set/string_spec.rb +2 -4
  20. data/spec/app/models/metasploit/model/search/operation/set_spec.rb +4 -6
  21. data/spec/app/models/metasploit/model/search/operation/string_spec.rb +2 -4
  22. data/spec/app/models/metasploit/model/search/operator/association_spec.rb +6 -8
  23. data/spec/app/models/metasploit/model/search/operator/attribute_spec.rb +12 -14
  24. data/spec/app/models/metasploit/model/search/operator/base_spec.rb +3 -5
  25. data/spec/app/models/metasploit/model/search/operator/delegation_spec.rb +13 -11
  26. data/spec/app/models/metasploit/model/search/operator/group/base_spec.rb +5 -7
  27. data/spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb +3 -5
  28. data/spec/app/models/metasploit/model/search/operator/group/union_spec.rb +3 -5
  29. data/spec/app/models/metasploit/model/search/operator/null_spec.rb +5 -7
  30. data/spec/app/models/metasploit/model/search/operator/single_spec.rb +26 -28
  31. data/spec/app/models/metasploit/model/search/query_spec.rb +48 -50
  32. data/spec/app/models/metasploit/model/visitation/visitor_spec.rb +7 -9
  33. data/spec/app/validators/ip_format_validator_spec.rb +7 -9
  34. data/spec/app/validators/nil_validator_spec.rb +3 -5
  35. data/spec/app/validators/parameters_validator_spec.rb +29 -29
  36. data/spec/app/validators/password_is_strong_validator_spec.rb +17 -19
  37. data/spec/lib/metasploit/model/association/error_spec.rb +1 -3
  38. data/spec/lib/metasploit/model/association_spec.rb +8 -10
  39. data/spec/lib/metasploit/model/base_spec.rb +3 -5
  40. data/spec/lib/metasploit/model/engine_spec.rb +48 -11
  41. data/spec/lib/metasploit/model/file_spec.rb +3 -5
  42. data/spec/lib/metasploit/model/invalid_spec.rb +7 -9
  43. data/spec/lib/metasploit/model/login/status_spec.rb +1 -3
  44. data/spec/lib/metasploit/model/nilify_blanks_spec.rb +11 -13
  45. data/spec/lib/metasploit/model/realm/key_spec.rb +15 -17
  46. data/spec/lib/metasploit/model/search/association/tree_spec.rb +3 -5
  47. data/spec/lib/metasploit/model/search/association_spec.rb +2 -4
  48. data/spec/lib/metasploit/model/search/attribute_spec.rb +6 -8
  49. data/spec/lib/metasploit/model/search/operation/value/integer_spec.rb +1 -3
  50. data/spec/lib/metasploit/model/search/operation/value/string_spec.rb +1 -3
  51. data/spec/lib/metasploit/model/search/operation_spec.rb +11 -13
  52. data/spec/lib/metasploit/model/search/operator/help_spec.rb +1 -3
  53. data/spec/lib/metasploit/model/search/with_spec.rb +7 -9
  54. data/spec/lib/metasploit/model/search_spec.rb +11 -13
  55. data/spec/lib/metasploit/model/spec/error_spec.rb +2 -4
  56. data/spec/lib/metasploit/model/spec/i18n_exception_handler_spec.rb +5 -7
  57. data/spec/lib/metasploit/model/spec/pathname_collision_spec.rb +4 -6
  58. data/spec/lib/metasploit/model/spec_spec.rb +9 -7
  59. data/spec/lib/metasploit/model/translation_spec.rb +10 -12
  60. data/spec/lib/metasploit/model/version_spec.rb +3 -5
  61. data/spec/lib/metasploit/model/visitation/visit_spec.rb +28 -26
  62. data/spec/matchers/validate_nilness_of_spec.rb +0 -2
  63. data/spec/spec_helper.rb +69 -7
  64. data/spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb +1 -1
  65. data/spec/support/shared/examples/metasploit/model/search/operation/value/integer.rb +8 -8
  66. data/spec/support/shared/examples/metasploit/model/search/operation/value/string.rb +5 -5
  67. data/spec/support/shared/examples/metasploit/model/search/operator/help.rb +18 -16
  68. data/spec/support/shared/examples/metasploit/model/translation.rb +4 -4
  69. data/spec/support/shared/examples/search/query.rb +3 -3
  70. data/spec/support/shared/examples/search_association.rb +2 -2
  71. data/spec/support/shared/examples/search_attribute.rb +3 -3
  72. data/spec/support/shared/examples/search_with.rb +3 -3
  73. metadata +2 -2
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Search::Operation::Value::Integer do
1
+ RSpec.describe Metasploit::Model::Search::Operation::Value::Integer do
4
2
  it_should_behave_like 'Metasploit::Model::Search::Operation::Value::Integer' do
5
3
  let(:operation_class) do
6
4
  described_class = self.described_class
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Search::Operation::Value::String do
1
+ RSpec.describe Metasploit::Model::Search::Operation::Value::String do
4
2
  it_should_behave_like 'Metasploit::Model::Search::Operation::Value::String' do
5
3
  let(:operation_class) do
6
4
  described_class = self.described_class
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Search::Operation do
1
+ RSpec.describe Metasploit::Model::Search::Operation do
4
2
  context 'parse' do
5
3
  subject(:parse) do
6
4
  described_class.parse(options)
@@ -48,8 +46,8 @@ describe Metasploit::Model::Search::Operation do
48
46
 
49
47
  context "with at least one ':' in :formatted_operation" do
50
48
  before(:each) do
51
- query.stub(:parse_operator).with(formatted_operator).and_return(operator)
52
- operator.stub(:operate_on).with(formatted_value).and_return(operation)
49
+ allow(query).to receive(:parse_operator).with(formatted_operator).and_return(operator)
50
+ allow(operator).to receive(:operate_on).with(formatted_value).and_return(operation)
53
51
  end
54
52
 
55
53
  context "with multiple ':' in :formatted_operation" do
@@ -58,13 +56,13 @@ describe Metasploit::Model::Search::Operation do
58
56
  end
59
57
 
60
58
  it "should treat portion before first ':' as formatted operator" do
61
- query.should_receive(:parse_operator).with(formatted_operator)
59
+ expect(query).to receive(:parse_operator).with(formatted_operator)
62
60
 
63
61
  parse
64
62
  end
65
63
 
66
64
  it "should treat portion after first ':' as formatted value including later ':'" do
67
- operator.should_receive(:operate_on).with(formatted_value)
65
+ expect(operator).to receive(:operate_on).with(formatted_value)
68
66
 
69
67
  parse
70
68
  end
@@ -76,13 +74,13 @@ describe Metasploit::Model::Search::Operation do
76
74
  end
77
75
 
78
76
  it "should use portion before ':' as formatted operator" do
79
- query.should_receive(:parse_operator).with(formatted_operator)
77
+ expect(query).to receive(:parse_operator).with(formatted_operator)
80
78
 
81
79
  parse
82
80
  end
83
81
 
84
82
  it "should use portion after ':' as formatted value" do
85
- operator.should_receive(:operate_on).with(formatted_value)
83
+ expect(operator).to receive(:operate_on).with(formatted_value)
86
84
 
87
85
  parse
88
86
  end
@@ -103,17 +101,17 @@ describe Metasploit::Model::Search::Operation do
103
101
  end
104
102
 
105
103
  it "should use entirety as formatted operator" do
106
- operator.stub(:operate_on).and_return(operation)
104
+ allow(operator).to receive(:operate_on).and_return(operation)
107
105
 
108
- query.should_receive(:parse_operator).with(formatted_operator).and_return(operator)
106
+ expect(query).to receive(:parse_operator).with(formatted_operator).and_return(operator)
109
107
 
110
108
  parse
111
109
  end
112
110
 
113
111
  it "should use '' as formatted value instead of nil" do
114
- query.stub(:parse_operator).and_return(operator)
112
+ allow(query).to receive(:parse_operator).and_return(operator)
115
113
 
116
- operator.should_receive(:operate_on).with('')
114
+ expect(operator).to receive(:operate_on).with('')
117
115
 
118
116
  parse
119
117
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Search::Operator::Help do
1
+ RSpec.describe Metasploit::Model::Search::Operator::Help do
4
2
  it_should_behave_like 'Metasploit::Model::Search::Operator::Help' do
5
3
  let(:operator) do
6
4
  operator_class.new(
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Search::With do
1
+ RSpec.describe Metasploit::Model::Search::With do
4
2
  let(:base_class) do
5
3
  described_class = self.described_class
6
4
 
@@ -37,7 +35,7 @@ describe Metasploit::Model::Search::With do
37
35
  end
38
36
 
39
37
  it 'should pass given options to operator_class.new' do
40
- operator_class.should_receive(:new).with(
38
+ expect(operator_class).to receive(:new).with(
41
39
  hash_including(options)
42
40
  ).and_return(operator)
43
41
 
@@ -45,7 +43,7 @@ describe Metasploit::Model::Search::With do
45
43
  end
46
44
 
47
45
  it 'should merge :klass into options passed to operator.new' do
48
- operator_class.should_receive(:new).with(
46
+ expect(operator_class).to receive(:new).with(
49
47
  hash_including(
50
48
  :klass => base_class
51
49
  )
@@ -55,9 +53,9 @@ describe Metasploit::Model::Search::With do
55
53
  end
56
54
 
57
55
  it 'should validate operator' do
58
- operator_class.stub(:new).and_return(operator)
56
+ allow(operator_class).to receive(:new).and_return(operator)
59
57
 
60
- operator.should_receive(:valid!)
58
+ expect(operator).to receive(:valid!)
61
59
 
62
60
  search_with_operator
63
61
  end
@@ -65,7 +63,7 @@ describe Metasploit::Model::Search::With do
65
63
  it 'should add operator to search_with_operator_by_name' do
66
64
  search_with_operator
67
65
 
68
- base_class.search_with_operator_by_name[operator.name].should == operator
66
+ expect(base_class.search_with_operator_by_name[operator.name]).to eq(operator)
69
67
  end
70
68
  end
71
69
 
@@ -75,7 +73,7 @@ describe Metasploit::Model::Search::With do
75
73
  end
76
74
 
77
75
  it 'should default to empty Hash' do
78
- search_with_operator_by_name.should == {}
76
+ expect(search_with_operator_by_name).to eq({})
79
77
  end
80
78
  end
81
79
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Search do
1
+ RSpec.describe Metasploit::Model::Search do
4
2
  subject(:base_instance) do
5
3
  base_class.new
6
4
  end
@@ -16,9 +14,9 @@ describe Metasploit::Model::Search do
16
14
  base_class.send(:include, described_class)
17
15
  end
18
16
 
19
- it { should be_a Metasploit::Model::Search::Association }
20
- it { should be_a Metasploit::Model::Search::Attribute }
21
- it { should be_a Metasploit::Model::Search::With }
17
+ it { is_expected.to be_a Metasploit::Model::Search::Association }
18
+ it { is_expected.to be_a Metasploit::Model::Search::Attribute }
19
+ it { is_expected.to be_a Metasploit::Model::Search::With }
22
20
 
23
21
  context 'search_operator_by_name' do
24
22
  subject(:search_operator_by_name) do
@@ -45,7 +43,7 @@ describe Metasploit::Model::Search do
45
43
  end
46
44
 
47
45
  it 'should be same as the attribute' do
48
- name.should == attribute
46
+ expect(name).to eq(attribute)
49
47
  end
50
48
  end
51
49
  end
@@ -90,7 +88,7 @@ describe Metasploit::Model::Search do
90
88
  "#{association}.#{associated_attribute}".to_sym
91
89
  end
92
90
 
93
- it { should be_a Metasploit::Model::Search::Operator::Association }
91
+ it { is_expected.to be_a Metasploit::Model::Search::Operator::Association }
94
92
 
95
93
  context 'association' do
96
94
  subject(:operator_association) do
@@ -98,7 +96,7 @@ describe Metasploit::Model::Search do
98
96
  end
99
97
 
100
98
  it 'should be the registered association' do
101
- operator_association.should == association
99
+ expect(operator_association).to eq(association)
102
100
  end
103
101
  end
104
102
 
@@ -112,7 +110,7 @@ describe Metasploit::Model::Search do
112
110
  end
113
111
 
114
112
  it 'should be operator from associated class' do
115
- source_operator.should == direct_attribute_operator
113
+ expect(source_operator).to eq(direct_attribute_operator)
116
114
  end
117
115
  end
118
116
 
@@ -122,7 +120,7 @@ describe Metasploit::Model::Search do
122
120
  end
123
121
 
124
122
  it 'should be class that called search_operator_by_name' do
125
- klass.should == base_class
123
+ expect(klass).to eq(base_class)
126
124
  end
127
125
  end
128
126
  end
@@ -155,7 +153,7 @@ describe Metasploit::Model::Search do
155
153
  end
156
154
 
157
155
  it 'should be in search_operator_by_name' do
158
- named_operator.should == operator
156
+ expect(named_operator).to eq(operator)
159
157
  end
160
158
  end
161
159
  end
@@ -163,7 +161,7 @@ describe Metasploit::Model::Search do
163
161
  context 'without search attribute' do
164
162
  context 'without search association' do
165
163
  context 'without search with' do
166
- it { should be_empty }
164
+ it { is_expected.to be_empty }
167
165
  end
168
166
  end
169
167
  end
@@ -1,5 +1,3 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Spec::Error do
4
- it { should be_a StandardError }
1
+ RSpec.describe Metasploit::Model::Spec::Error do
2
+ it { is_expected.to be_a StandardError }
5
3
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Spec::I18nExceptionHandler do
1
+ RSpec.describe Metasploit::Model::Spec::I18nExceptionHandler do
4
2
  subject(:i18n_exception_handler) do
5
3
  described_class.new
6
4
  end
@@ -32,10 +30,10 @@ describe Metasploit::Model::Spec::I18nExceptionHandler do
32
30
  expect {
33
31
  call
34
32
  }.to raise_error(converted_exception.class) do |actual_exception|
35
- actual_exception.class == converted_exception.class
36
- actual_exception.key.should == converted_exception.key
37
- actual_exception.locale.should == converted_exception.locale
38
- actual_exception.options.should == converted_exception.options
33
+ expect(actual_exception.class).to eq(converted_exception.class)
34
+ expect(actual_exception.key).to eq(converted_exception.key)
35
+ expect(actual_exception.locale).to eq(converted_exception.locale)
36
+ expect(actual_exception.options).to eq(converted_exception.options)
39
37
  end
40
38
  end
41
39
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Spec::PathnameCollision do
1
+ RSpec.describe Metasploit::Model::Spec::PathnameCollision do
4
2
  let(:pathname) do
5
3
  Metasploit::Model::Spec.temporary_pathname.join('pathname')
6
4
  end
@@ -9,7 +7,7 @@ describe Metasploit::Model::Spec::PathnameCollision do
9
7
  described_class.new(pathname)
10
8
  end
11
9
 
12
- it { should be_a Metasploit::Model::Spec::Error }
10
+ it { is_expected.to be_a Metasploit::Model::Spec::Error }
13
11
 
14
12
  context 'check!' do
15
13
  subject(:check!) do
@@ -44,11 +42,11 @@ describe Metasploit::Model::Spec::PathnameCollision do
44
42
  end
45
43
 
46
44
  it 'should include pathname' do
47
- message.should include("#{pathname} already exists.")
45
+ expect(message).to include("#{pathname} already exists.")
48
46
  end
49
47
 
50
48
  it 'should include potential cause' do
51
- message.should include('Metasploit::Model::Spec.remove_temporary_pathname was not called after the previous spec.')
49
+ expect(message).to include('Metasploit::Model::Spec.remove_temporary_pathname was not called after the previous spec.')
52
50
  end
53
51
  end
54
52
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Spec do
1
+ RSpec.describe Metasploit::Model::Spec do
4
2
  before(:each) do
5
3
  @before_temporary_pathname = described_class.send(:remove_instance_variable, :@temporary_pathname)
6
4
  end
@@ -35,11 +33,11 @@ describe Metasploit::Model::Spec do
35
33
  end
36
34
 
37
35
  it 'should remove file tree' do
38
- pathname.exist?.should be_true
36
+ expect(pathname.exist?).to eq(true)
39
37
 
40
38
  remove_temporary_pathname
41
39
 
42
- pathname.exist?.should be_false
40
+ expect(pathname.exist?).to eq(false)
43
41
  end
44
42
  end
45
43
 
@@ -82,7 +80,7 @@ describe Metasploit::Model::Spec do
82
80
  end
83
81
 
84
82
  it 'should return set pathname' do
85
- temporary_pathname.should == pathname
83
+ expect(temporary_pathname).to eq(pathname)
86
84
  end
87
85
  end
88
86
 
@@ -107,7 +105,11 @@ describe Metasploit::Model::Spec do
107
105
  expect {
108
106
  described_class.temporary_pathname = temporary_pathname
109
107
  }.to change {
110
- described_class.instance_variable_get(:@temporary_pathname)
108
+ if described_class.instance_variable_defined? :@temporary_pathname
109
+ described_class.instance_variable_get(:@temporary_pathname)
110
+ else
111
+ nil
112
+ end
111
113
  }.to(temporary_pathname)
112
114
  end
113
115
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Translation do
1
+ RSpec.describe Metasploit::Model::Translation do
4
2
  let(:base_class) do
5
3
  described_class = self.described_class
6
4
 
@@ -56,21 +54,21 @@ describe Metasploit::Model::Translation do
56
54
  end
57
55
 
58
56
  it 'should have named and unnamed ancestors' do
59
- base_class.ancestors.should include(named_class)
60
- base_class.ancestors.should include(named_module)
61
- base_class.ancestors.should include(unnamed_class)
62
- base_class.ancestors.should include(unnamed_module)
57
+ expect(base_class.ancestors).to include(named_class)
58
+ expect(base_class.ancestors).to include(named_module)
59
+ expect(base_class.ancestors).to include(unnamed_class)
60
+ expect(base_class.ancestors).to include(unnamed_module)
63
61
  end
64
62
 
65
63
  it 'should return all ancestors that respond to model_name' do
66
- lookup_ancestors.should include(base_class)
67
- lookup_ancestors.should include(named_class)
68
- lookup_ancestors.should include(named_module)
64
+ expect(lookup_ancestors).to include(base_class)
65
+ expect(lookup_ancestors).to include(named_class)
66
+ expect(lookup_ancestors).to include(named_module)
69
67
  end
70
68
 
71
69
  it 'should not return ancestors that do not respond to model_name' do
72
- lookup_ancestors.should_not include(unnamed_class)
73
- lookup_ancestors.should_not include(unnamed_module)
70
+ expect(lookup_ancestors).not_to include(unnamed_class)
71
+ expect(lookup_ancestors).not_to include(unnamed_module)
74
72
  end
75
73
  end
76
74
 
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Version do
1
+ RSpec.describe Metasploit::Model::Version do
4
2
  context 'CONSTANTS' do
5
3
  context 'MAJOR' do
6
4
  subject(:major) do
@@ -17,7 +15,7 @@ describe Metasploit::Model::Version do
17
15
  described_class::MINOR
18
16
  end
19
17
 
20
- it { should be_a Integer }
18
+ it { is_expected.to be_a Integer }
21
19
  end
22
20
 
23
21
  context 'PATCH' do
@@ -25,7 +23,7 @@ describe Metasploit::Model::Version do
25
23
  described_class::PATCH
26
24
  end
27
25
 
28
- it { should be_a Integer }
26
+ it { is_expected.to be_a Integer }
29
27
  end
30
28
 
31
29
  pull_request = ENV['TRAVIS_PULL_REQUEST']
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Model::Visitation::Visit do
1
+ RSpec.describe Metasploit::Model::Visitation::Visit do
4
2
  let(:base_class) do
5
3
  described_class = self.described_class
6
4
 
@@ -54,15 +52,15 @@ describe Metasploit::Model::Visitation::Visit do
54
52
  end
55
53
 
56
54
  it 'should return Array(Metasploit::Model::Visitation::Visitor)' do
57
- visit.should be_an Array
58
- visit.length.should == 1
59
- visit.first.should be_a Metasploit::Model::Visitation::Visitor
55
+ expect(visit).to be_an Array
56
+ expect(visit.length).to eq(1)
57
+ expect(visit.first).to be_a Metasploit::Model::Visitation::Visitor
60
58
  end
61
59
 
62
60
  it 'should add Metasploit::Model::Visitation::Visitor to visitor_by_module_name' do
63
61
  visitor = visit.first
64
62
 
65
- base_class.visitor_by_module_name[mod.name].should == visitor
63
+ expect(base_class.visitor_by_module_name[mod.name]).to eq(visitor)
66
64
  end
67
65
  end
68
66
 
@@ -88,18 +86,22 @@ describe Metasploit::Model::Visitation::Visit do
88
86
  end
89
87
 
90
88
  it 'should return Array<Metasploit::Model::Visitation::Visitor>' do
91
- visit.should be_an Array
92
- visit.length.should == module_names.length
93
-
94
- visit.all? { |visitor|
95
- visitor.is_a? Metasploit::Model::Visitation::Visitor
96
- }.should be_true
89
+ expect(visit).to be_an Array
90
+ expect(visit.length).to eq(module_names.length)
91
+
92
+ expect(
93
+ visit.all? { |visitor|
94
+ visitor.is_a? Metasploit::Model::Visitation::Visitor
95
+ }
96
+ ).to eq(true)
97
97
  end
98
98
 
99
99
  it 'should each Metasploit::Model::Visitation::Visitor to visitor_by_module_name' do
100
- module_names.all? { |module_name|
101
- visit.include? base_class.visitor_by_module_name[module_name]
102
- }.should be_true
100
+ expect(
101
+ module_names.all? { |module_name|
102
+ visit.include? base_class.visitor_by_module_name[module_name]
103
+ }
104
+ ).to eq(true)
103
105
  end
104
106
  end
105
107
  end
@@ -158,7 +160,7 @@ describe Metasploit::Model::Visitation::Visit do
158
160
  end
159
161
 
160
162
  it 'should return visitor from visitor_by_module' do
161
- visitor.should == klass_visitor
163
+ expect(visitor).to eq(klass_visitor)
162
164
  end
163
165
  end
164
166
 
@@ -187,13 +189,13 @@ describe Metasploit::Model::Visitation::Visit do
187
189
  end
188
190
 
189
191
  it 'should return ancestor visitor' do
190
- visitor.should == ancestor_visitor
192
+ expect(visitor).to eq(ancestor_visitor)
191
193
  end
192
194
 
193
195
  it 'should cache ancestor visitor as visitor for klass in visitor_by_module' do
194
196
  visitor
195
197
 
196
- base_class.visitor_by_module[klass].should == ancestor_visitor
198
+ expect(base_class.visitor_by_module[klass]).to eq(ancestor_visitor)
197
199
  end
198
200
  end
199
201
 
@@ -203,13 +205,13 @@ describe Metasploit::Model::Visitation::Visit do
203
205
  end
204
206
 
205
207
  it 'should return ancestor visitor' do
206
- visitor.should == ancestor_visitor
208
+ expect(visitor).to eq(ancestor_visitor)
207
209
  end
208
210
 
209
211
  it 'should cache ancestor visitor as visitor for klass in visitor_by_module' do
210
212
  visitor
211
213
 
212
- base_class.visitor_by_module[klass].should == ancestor_visitor
214
+ expect(base_class.visitor_by_module[klass]).to eq(ancestor_visitor)
213
215
  end
214
216
  end
215
217
 
@@ -229,7 +231,7 @@ describe Metasploit::Model::Visitation::Visit do
229
231
  end
230
232
 
231
233
  it 'should default to empty Hash' do
232
- visitor_by_module.should == {}
234
+ expect(visitor_by_module).to eq({})
233
235
  end
234
236
  end
235
237
 
@@ -239,7 +241,7 @@ describe Metasploit::Model::Visitation::Visit do
239
241
  end
240
242
 
241
243
  it 'should default to empty Hash' do
242
- visitor_by_module_name.should == {}
244
+ expect(visitor_by_module_name).to eq({})
243
245
  end
244
246
  end
245
247
 
@@ -274,13 +276,13 @@ describe Metasploit::Model::Visitation::Visit do
274
276
  end
275
277
 
276
278
  it 'should find visitor for node.class' do
277
- base_class.should_receive(:visitor).with(node.class).and_call_original
279
+ expect(base_class).to receive(:visitor).with(node.class).and_call_original
278
280
 
279
281
  visit
280
282
  end
281
283
 
282
284
  it 'should visit on visitor' do
283
- @visitor.should_receive(:visit).with(base_instance, node)
285
+ expect(@visitor).to receive(:visit).with(base_instance, node)
284
286
 
285
287
  visit
286
288
  end
@@ -309,7 +311,7 @@ describe Metasploit::Model::Visitation::Visit do
309
311
  end
310
312
 
311
313
  it "should be able to call visit from inside a visitor's block" do
312
- visit.should == leaf_node
314
+ expect(visit).to eq(leaf_node)
313
315
  end
314
316
  end
315
317
  end