metasploit_data_models 0.24.1.pre.rspec.pre.3.pre.1 → 0.24.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +3 -3
- data/Gemfile +3 -1
- data/app/models/metasploit_data_models/ip_address/v4/segmented.rb +1 -1
- data/app/models/metasploit_data_models/search/visitor/where.rb +1 -1
- data/app/validators/password_is_strong_validator.rb +1 -1
- data/lib/mdm/host/operating_system_normalization.rb +10 -0
- data/lib/metasploit_data_models/version.rb +1 -2
- data/metasploit_data_models.gemspec +1 -1
- data/spec/app/models/mdm/api_key_spec.rb +3 -1
- data/spec/app/models/mdm/client_spec.rb +11 -9
- data/spec/app/models/mdm/cred_spec.rb +54 -42
- data/spec/app/models/mdm/event_spec.rb +23 -21
- data/spec/app/models/mdm/exploit_attempt_spec.rb +21 -19
- data/spec/app/models/mdm/exploited_host_spec.rb +13 -11
- data/spec/app/models/mdm/host_detail_spec.rb +17 -15
- data/spec/app/models/mdm/host_spec.rb +260 -261
- data/spec/app/models/mdm/host_tag_spec.rb +8 -6
- data/spec/app/models/mdm/listener_spec.rb +32 -30
- data/spec/app/models/mdm/loot_spec.rb +23 -21
- data/spec/app/models/mdm/macro_spec.rb +3 -1
- data/spec/app/models/mdm/mod_ref_spec.rb +3 -1
- data/spec/app/models/mdm/module/action_spec.rb +12 -10
- data/spec/app/models/mdm/module/arch_spec.rb +12 -10
- data/spec/app/models/mdm/module/author_spec.rb +17 -22
- data/spec/app/models/mdm/module/detail_spec.rb +75 -184
- data/spec/app/models/mdm/module/mixin_spec.rb +12 -10
- data/spec/app/models/mdm/module/platform_spec.rb +12 -10
- data/spec/app/models/mdm/module/ref_spec.rb +12 -10
- data/spec/app/models/mdm/module/target_spec.rb +15 -13
- data/spec/app/models/mdm/nexpose_console_spec.rb +37 -35
- data/spec/app/models/mdm/note_spec.rb +25 -23
- data/spec/app/models/mdm/profile_spec.rb +3 -1
- data/spec/app/models/mdm/ref_spec.rb +12 -10
- data/spec/app/models/mdm/route_spec.rb +8 -6
- data/spec/app/models/mdm/service_spec.rb +40 -38
- data/spec/app/models/mdm/session_event_spec.rb +12 -10
- data/spec/app/models/mdm/session_spec.rb +15 -13
- data/spec/app/models/mdm/tag_spec.rb +29 -29
- data/spec/app/models/mdm/task_cred_spec.rb +11 -9
- data/spec/app/models/mdm/task_host_spec.rb +11 -9
- data/spec/app/models/mdm/task_service_spec.rb +11 -9
- data/spec/app/models/mdm/task_session_spec.rb +9 -7
- data/spec/app/models/mdm/task_spec.rb +29 -27
- data/spec/app/models/mdm/user_spec.rb +19 -17
- data/spec/app/models/mdm/vuln_attempt_spec.rb +16 -14
- data/spec/app/models/mdm/vuln_detail_spec.rb +28 -26
- data/spec/app/models/mdm/vuln_ref_spec.rb +10 -8
- data/spec/app/models/mdm/vuln_spec.rb +26 -24
- data/spec/app/models/mdm/web_form_spec.rb +13 -11
- data/spec/app/models/mdm/web_page_spec.rb +21 -19
- data/spec/app/models/mdm/web_site_spec.rb +23 -21
- data/spec/app/models/mdm/web_vuln_spec.rb +65 -63
- data/spec/app/models/mdm/wmap_request_spec.rb +3 -1
- data/spec/app/models/mdm/wmap_target_spec.rb +3 -1
- data/spec/app/models/mdm/workspace_spec.rb +100 -97
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +5 -3
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +15 -13
- data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/ip_address/v4/cidr_spec.rb +12 -10
- data/spec/app/models/metasploit_data_models/ip_address/v4/nmap_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +23 -21
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +11 -9
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +23 -21
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/segmented_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/ip_address/v4/segment/single_spec.rb +15 -22
- data/spec/app/models/metasploit_data_models/ip_address/v4/single_spec.rb +6 -4
- data/spec/app/models/metasploit_data_models/module_run_spec.rb +3 -1
- data/spec/app/models/metasploit_data_models/search/operation/ip_address_spec.rb +20 -18
- data/spec/app/models/metasploit_data_models/search/operation/port/number_spec.rb +8 -6
- data/spec/app/models/metasploit_data_models/search/operation/port/range_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operation/range_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operator/ip_address_spec.rb +4 -2
- data/spec/app/models/metasploit_data_models/search/operator/multitext_spec.rb +10 -8
- data/spec/app/models/metasploit_data_models/search/operator/port/list_spec.rb +8 -6
- data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +11 -9
- data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +7 -5
- data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +19 -17
- data/spec/app/models/metasploit_data_models/search/visitor/method_spec.rb +7 -5
- data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +23 -61
- data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +10 -8
- data/spec/app/validators/parameters_validator_spec.rb +29 -29
- data/spec/app/validators/password_is_strong_validator_spec.rb +46 -54
- data/spec/factories/mdm/module/details.rb +1 -1
- data/spec/lib/base64_serializer_spec.rb +19 -19
- data/spec/lib/metasploit_data_models/ip_address/cidr_spec.rb +12 -18
- data/spec/lib/metasploit_data_models/ip_address/range_spec.rb +6 -4
- data/spec/lib/metasploit_data_models/match/child_spec.rb +4 -2
- data/spec/lib/metasploit_data_models/match/parent_spec.rb +6 -4
- data/spec/lib/metasploit_data_models/version_spec.rb +5 -3
- data/spec/spec_helper.rb +6 -72
- data/spec/support/shared/examples/mdm/module/detail/does_not_support_stance_with_mtype.rb +2 -2
- data/spec/support/shared/examples/mdm/module/detail/supports_stance_with_mtype.rb +4 -4
- data/spec/support/shared/examples/metasploit_data_models/search/operation/ipaddress/match.rb +2 -2
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_children.rb +5 -5
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_metasploit_model_search_operation_base.rb +5 -5
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb +3 -3
- data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_metasploit_model_search_group_base.rb +6 -7
- metadata +7 -7
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
3
|
+
describe MetasploitDataModels::Base64Serializer do
|
4
4
|
let(:base64_marshaled) do
|
5
5
|
marshaled = Marshal.dump(unserialized)
|
6
6
|
|
@@ -30,7 +30,7 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
30
30
|
|
31
31
|
context 'CONSTANTS' do
|
32
32
|
it 'should define DEFAULT' do
|
33
|
-
|
33
|
+
described_class::DEFAULT.should == default
|
34
34
|
end
|
35
35
|
|
36
36
|
context 'LOADERS' do
|
@@ -38,36 +38,36 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
38
38
|
first = described_class::LOADERS[0]
|
39
39
|
deserialized = first.call(base64_marshaled)
|
40
40
|
|
41
|
-
|
41
|
+
deserialized.should == unserialized
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'should fallback to the old YAML format second' do
|
45
45
|
second = described_class::LOADERS[1]
|
46
46
|
deserialized = second.call(yaml)
|
47
47
|
|
48
|
-
|
48
|
+
deserialized.should == unserialized
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'should finally give up and just return the value' do
|
52
52
|
last = described_class::LOADERS.last
|
53
53
|
deserialized = last.call(unserialized)
|
54
54
|
|
55
|
-
|
55
|
+
deserialized.should == unserialized
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
context '#default' do
|
61
61
|
it 'should default to {}' do
|
62
|
-
|
62
|
+
base64_serializer.default.should == {}
|
63
63
|
end
|
64
64
|
|
65
65
|
it 'should return a duplicate' do
|
66
66
|
duplicate = base64_serializer.default
|
67
|
-
value =
|
67
|
+
value = mock('Value')
|
68
68
|
duplicate[:key] = value
|
69
69
|
|
70
|
-
|
70
|
+
duplicate.should_not == base64_serializer.default
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -75,7 +75,7 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
75
75
|
it 'should output Base64 encoded marshaled data' do
|
76
76
|
dumped = base64_serializer.dump(unserialized)
|
77
77
|
|
78
|
-
|
78
|
+
dumped.should == base64_marshaled
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -105,21 +105,21 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
105
105
|
end
|
106
106
|
|
107
107
|
it 'should have :default in attributes' do
|
108
|
-
|
108
|
+
attributes.should have_key(:default)
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'should set default to :default value' do
|
112
|
-
|
112
|
+
base64_serializer.default.should == attributes[:default]
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
116
|
context 'without :default' do
|
117
117
|
it 'should not have :default in attributes' do
|
118
|
-
|
118
|
+
attributes.should_not have_key(:default)
|
119
119
|
end
|
120
120
|
|
121
121
|
it 'should default #default to DEFAULT' do
|
122
|
-
|
122
|
+
base64_serializer.default.should == default
|
123
123
|
end
|
124
124
|
end
|
125
125
|
end
|
@@ -131,11 +131,11 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
131
131
|
end
|
132
132
|
|
133
133
|
it 'should return #default' do
|
134
|
-
default =
|
135
|
-
|
134
|
+
default = mock('Default')
|
135
|
+
base64_serializer.stub(:default => default)
|
136
136
|
deserialized = base64_serializer.load(serialized)
|
137
137
|
|
138
|
-
|
138
|
+
deserialized.should == default
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
@@ -143,7 +143,7 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
143
143
|
it 'should return unserialized' do
|
144
144
|
deserialized = base64_serializer.load(base64_marshaled)
|
145
145
|
|
146
|
-
|
146
|
+
deserialized.should == unserialized
|
147
147
|
end
|
148
148
|
|
149
149
|
end
|
@@ -152,7 +152,7 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
152
152
|
it 'should return unserialized' do
|
153
153
|
deserialized = base64_serializer.load(yaml)
|
154
154
|
|
155
|
-
|
155
|
+
deserialized.should == unserialized
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
@@ -165,7 +165,7 @@ RSpec.describe MetasploitDataModels::Base64Serializer do
|
|
165
165
|
it 'should return raw value' do
|
166
166
|
deserialized = base64_serializer.load(raw_value)
|
167
167
|
|
168
|
-
|
168
|
+
deserialized.should == raw_value
|
169
169
|
end
|
170
170
|
end
|
171
171
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MetasploitDataModels::IPAddress::CIDR do
|
2
4
|
subject(:including_class_instance) {
|
3
5
|
including_class.new(
|
4
6
|
value: formatted_value
|
@@ -78,7 +80,7 @@ RSpec.describe MetasploitDataModels::IPAddress::CIDR do
|
|
78
80
|
described_class::SEPARATOR
|
79
81
|
}
|
80
82
|
|
81
|
-
it {
|
83
|
+
it { should == '/' }
|
82
84
|
end
|
83
85
|
end
|
84
86
|
|
@@ -108,7 +110,7 @@ RSpec.describe MetasploitDataModels::IPAddress::CIDR do
|
|
108
110
|
true
|
109
111
|
}
|
110
112
|
|
111
|
-
it {
|
113
|
+
it { should_not include(invalid_error) }
|
112
114
|
end
|
113
115
|
|
114
116
|
context 'without valid' do
|
@@ -116,7 +118,7 @@ RSpec.describe MetasploitDataModels::IPAddress::CIDR do
|
|
116
118
|
false
|
117
119
|
}
|
118
120
|
|
119
|
-
it {
|
121
|
+
it { should include(invalid_error) }
|
120
122
|
end
|
121
123
|
end
|
122
124
|
|
@@ -129,7 +131,7 @@ RSpec.describe MetasploitDataModels::IPAddress::CIDR do
|
|
129
131
|
I18n.translate!('errors.messages.blank')
|
130
132
|
}
|
131
133
|
|
132
|
-
it {
|
134
|
+
it { should include(blank_error) }
|
133
135
|
end
|
134
136
|
end
|
135
137
|
|
@@ -164,7 +166,7 @@ RSpec.describe MetasploitDataModels::IPAddress::CIDR do
|
|
164
166
|
end
|
165
167
|
}
|
166
168
|
|
167
|
-
it {
|
169
|
+
it { should be_nil }
|
168
170
|
end
|
169
171
|
end
|
170
172
|
|
@@ -206,8 +208,8 @@ RSpec.describe MetasploitDataModels::IPAddress::CIDR do
|
|
206
208
|
regexp.names
|
207
209
|
}
|
208
210
|
|
209
|
-
it {
|
210
|
-
it {
|
211
|
+
it { should include 'address' }
|
212
|
+
it { should include 'prefix_length' }
|
211
213
|
end
|
212
214
|
end
|
213
215
|
|
@@ -220,17 +222,9 @@ RSpec.describe MetasploitDataModels::IPAddress::CIDR do
|
|
220
222
|
Class.new(Metasploit::Model::Base) {
|
221
223
|
attr_accessor :value
|
222
224
|
}.tap { |address_class|
|
223
|
-
outer_segment_class = self.segment_class
|
224
|
-
|
225
|
-
address_class.define_singleton_method(:segment_class) do
|
226
|
-
outer_segment_class
|
227
|
-
end
|
228
225
|
|
229
|
-
|
230
|
-
|
231
|
-
address_class.define_singleton_method(:segment_count) do
|
232
|
-
outer_segment_count
|
233
|
-
end
|
226
|
+
allow(address_class).to receive(:segment_class).and_return(segment_class)
|
227
|
+
allow(address_class).to receive(:segment_count).and_return(segment_count)
|
234
228
|
}
|
235
229
|
}
|
236
230
|
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MetasploitDataModels::IPAddress::Range do
|
2
4
|
subject(:range) {
|
3
5
|
range_class.new
|
4
6
|
}
|
@@ -33,7 +35,7 @@ RSpec.describe MetasploitDataModels::IPAddress::Range do
|
|
33
35
|
'invalid_value'
|
34
36
|
}
|
35
37
|
|
36
|
-
it {
|
38
|
+
it { should be_nil }
|
37
39
|
end
|
38
40
|
end
|
39
41
|
|
@@ -42,7 +44,7 @@ RSpec.describe MetasploitDataModels::IPAddress::Range do
|
|
42
44
|
nil
|
43
45
|
}
|
44
46
|
|
45
|
-
it {
|
47
|
+
it { should be_nil }
|
46
48
|
end
|
47
49
|
end
|
48
50
|
end
|
@@ -65,7 +67,7 @@ RSpec.describe MetasploitDataModels::IPAddress::Range do
|
|
65
67
|
described_class::SEPARATOR
|
66
68
|
}
|
67
69
|
|
68
|
-
it {
|
70
|
+
it { should == '-' }
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MetasploitDataModels::Match::Child do
|
2
4
|
let(:extending_class) {
|
3
5
|
# capture as local for Class.new block scope
|
4
6
|
described_class = self.described_class
|
@@ -52,7 +54,7 @@ RSpec.describe MetasploitDataModels::Match::Child do
|
|
52
54
|
'1,2-3'
|
53
55
|
end
|
54
56
|
|
55
|
-
it {
|
57
|
+
it { should be_nil }
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MetasploitDataModels::Match::Parent do
|
2
4
|
let(:including_class) {
|
3
5
|
described_class = self.described_class
|
4
6
|
|
@@ -17,7 +19,7 @@ RSpec.describe MetasploitDataModels::Match::Parent do
|
|
17
19
|
}
|
18
20
|
|
19
21
|
context 'default' do
|
20
|
-
it {
|
22
|
+
it { should == [] }
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
@@ -84,7 +86,7 @@ RSpec.describe MetasploitDataModels::Match::Parent do
|
|
84
86
|
match_child
|
85
87
|
end
|
86
88
|
|
87
|
-
it {
|
89
|
+
it { should be_nil }
|
88
90
|
end
|
89
91
|
end
|
90
92
|
|
@@ -94,7 +96,7 @@ RSpec.describe MetasploitDataModels::Match::Parent do
|
|
94
96
|
}
|
95
97
|
|
96
98
|
context 'default' do
|
97
|
-
it {
|
99
|
+
it { should == [] }
|
98
100
|
end
|
99
101
|
|
100
102
|
context 'with class names' do
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MetasploitDataModels::Version do
|
2
4
|
context 'CONSTANTS' do
|
3
5
|
context 'MAJOR' do
|
4
6
|
subject(:major) do
|
@@ -15,7 +17,7 @@ RSpec.describe MetasploitDataModels::Version do
|
|
15
17
|
described_class::MINOR
|
16
18
|
end
|
17
19
|
|
18
|
-
it {
|
20
|
+
it { should be_a Integer }
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'PATCH' do
|
@@ -23,7 +25,7 @@ RSpec.describe MetasploitDataModels::Version do
|
|
23
25
|
described_class::PATCH
|
24
26
|
end
|
25
27
|
|
26
|
-
it {
|
28
|
+
it { should be_a Integer }
|
27
29
|
end
|
28
30
|
|
29
31
|
pull_request = ENV['TRAVIS_PULL_REQUEST']
|
data/spec/spec_helper.rb
CHANGED
@@ -22,6 +22,7 @@ end
|
|
22
22
|
|
23
23
|
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
24
24
|
require 'rspec/rails'
|
25
|
+
require 'rspec/autorun'
|
25
26
|
|
26
27
|
# full backtrace in logs so its easier to trace errors
|
27
28
|
Rails.backtrace_cleaner.remove_silencers!
|
@@ -43,80 +44,13 @@ engines.each do |engine|
|
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
46
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
47
47
|
RSpec.configure do |config|
|
48
|
-
# rspec-expectations config goes here. You can use an alternate
|
49
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
50
|
-
# assertions if you prefer.
|
51
|
-
config.expect_with :rspec do |expectations|
|
52
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
53
|
-
# and `failure_message` of custom matchers include text for helper methods
|
54
|
-
# defined using `chain`, e.g.:
|
55
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
56
|
-
# # => "be bigger than 2 and smaller than 4"
|
57
|
-
# ...rather than:
|
58
|
-
# # => "be bigger than 2"
|
59
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
60
|
-
end
|
61
|
-
|
62
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
63
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
64
|
-
config.mock_with :rspec do |mocks|
|
65
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
66
|
-
# a real object. This is generally recommended, and will default to
|
67
|
-
# `true` in RSpec 4.
|
68
|
-
mocks.verify_partial_doubles = true
|
69
|
-
end
|
70
|
-
|
71
|
-
# These two settings work together to allow you to limit a spec run
|
72
|
-
# to individual examples or groups you care about by tagging them with
|
73
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
74
|
-
# get run.
|
75
|
-
config.filter_run :focus
|
76
|
-
config.run_all_when_everything_filtered = true
|
77
|
-
|
78
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
79
|
-
# recommended. For more details, see:
|
80
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
81
|
-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
82
|
-
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
83
|
-
config.disable_monkey_patching!
|
84
|
-
|
85
|
-
# This setting enables warnings. It's recommended, but in some cases may
|
86
|
-
# be too noisy due to issues in dependencies.
|
87
|
-
config.warnings = true
|
88
|
-
|
89
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
90
|
-
# file, and it's useful to allow more verbose output when running an
|
91
|
-
# individual spec file.
|
92
|
-
if config.files_to_run.one?
|
93
|
-
# Use the documentation formatter for detailed output,
|
94
|
-
# unless a formatter has already been configured
|
95
|
-
# (e.g. via a command-line flag).
|
96
|
-
config.default_formatter = 'doc'
|
97
|
-
end
|
98
|
-
|
99
|
-
# Print the 10 slowest examples and example groups at the
|
100
|
-
# end of the spec run, to help surface which specs are running
|
101
|
-
# particularly slow.
|
102
|
-
config.profile_examples = 10
|
103
|
-
|
104
|
-
# Run specs in random order to surface order dependencies. If you find an
|
105
|
-
# order dependency and want to debug it, you can fix the order by providing
|
106
|
-
# the seed, which is printed after each run.
|
107
|
-
# --seed 1234
|
108
|
-
config.order = :random
|
109
|
-
|
110
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
111
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
112
|
-
# test failures related to randomization by passing the same `--seed` value
|
113
|
-
# as the one that triggered the failure.
|
114
|
-
Kernel.srand config.seed
|
115
|
-
|
116
|
-
config.use_transactional_fixtures = true
|
117
|
-
|
118
48
|
config.before(:each) do
|
119
49
|
# Rex is only available when testing with metasploit-framework or pro, so stub out the methods that require it
|
120
|
-
|
50
|
+
Mdm::Workspace.any_instance.stub(:valid_ip_or_range? => true)
|
121
51
|
end
|
52
|
+
|
53
|
+
config.mock_with :rspec
|
54
|
+
config.use_transactional_fixtures = true
|
55
|
+
config.order = :random
|
122
56
|
end
|
@@ -6,7 +6,7 @@ shared_examples_for 'Mdm::Module::Detail does not support stance with mtype' do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'should return false for supports_stance?' do
|
9
|
-
|
9
|
+
detail.supports_stance?.should be_false
|
10
10
|
end
|
11
11
|
|
12
12
|
context 'with nil stance' do
|
@@ -14,7 +14,7 @@ shared_examples_for 'Mdm::Module::Detail does not support stance with mtype' do
|
|
14
14
|
nil
|
15
15
|
end
|
16
16
|
|
17
|
-
it {
|
17
|
+
it { should be_valid }
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|