metasploit_data_models 0.24.0 → 0.24.1.pre.rspec.pre.3.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -3
  3. data/Gemfile +1 -3
  4. data/app/models/metasploit_data_models/ip_address/v4/segmented.rb +1 -1
  5. data/app/models/metasploit_data_models/search/visitor/where.rb +1 -1
  6. data/app/validators/password_is_strong_validator.rb +1 -1
  7. data/lib/mdm/host/operating_system_normalization.rb +0 -10
  8. data/lib/metasploit_data_models/version.rb +2 -2
  9. data/metasploit_data_models.gemspec +1 -1
  10. data/spec/app/models/mdm/api_key_spec.rb +1 -3
  11. data/spec/app/models/mdm/client_spec.rb +9 -11
  12. data/spec/app/models/mdm/cred_spec.rb +42 -54
  13. data/spec/app/models/mdm/event_spec.rb +21 -23
  14. data/spec/app/models/mdm/exploit_attempt_spec.rb +19 -21
  15. data/spec/app/models/mdm/exploited_host_spec.rb +11 -13
  16. data/spec/app/models/mdm/host_detail_spec.rb +15 -17
  17. data/spec/app/models/mdm/host_spec.rb +261 -260
  18. data/spec/app/models/mdm/host_tag_spec.rb +6 -8
  19. data/spec/app/models/mdm/listener_spec.rb +30 -32
  20. data/spec/app/models/mdm/loot_spec.rb +21 -23
  21. data/spec/app/models/mdm/macro_spec.rb +1 -3
  22. data/spec/app/models/mdm/mod_ref_spec.rb +1 -3
  23. data/spec/app/models/mdm/module/action_spec.rb +10 -12
  24. data/spec/app/models/mdm/module/arch_spec.rb +10 -12
  25. data/spec/app/models/mdm/module/author_spec.rb +22 -17
  26. data/spec/app/models/mdm/module/detail_spec.rb +184 -75
  27. data/spec/app/models/mdm/module/mixin_spec.rb +10 -12
  28. data/spec/app/models/mdm/module/platform_spec.rb +10 -12
  29. data/spec/app/models/mdm/module/ref_spec.rb +10 -12
  30. data/spec/app/models/mdm/module/target_spec.rb +13 -15
  31. data/spec/app/models/mdm/nexpose_console_spec.rb +35 -37
  32. data/spec/app/models/mdm/note_spec.rb +23 -25
  33. data/spec/app/models/mdm/profile_spec.rb +1 -3
  34. data/spec/app/models/mdm/ref_spec.rb +10 -12
  35. data/spec/app/models/mdm/route_spec.rb +6 -8
  36. data/spec/app/models/mdm/service_spec.rb +38 -40
  37. data/spec/app/models/mdm/session_event_spec.rb +10 -12
  38. data/spec/app/models/mdm/session_spec.rb +13 -15
  39. data/spec/app/models/mdm/tag_spec.rb +29 -29
  40. data/spec/app/models/mdm/task_cred_spec.rb +9 -11
  41. data/spec/app/models/mdm/task_host_spec.rb +9 -11
  42. data/spec/app/models/mdm/task_service_spec.rb +9 -11
  43. data/spec/app/models/mdm/task_session_spec.rb +7 -9
  44. data/spec/app/models/mdm/task_spec.rb +27 -29
  45. data/spec/app/models/mdm/user_spec.rb +17 -19
  46. data/spec/app/models/mdm/vuln_attempt_spec.rb +14 -16
  47. data/spec/app/models/mdm/vuln_detail_spec.rb +26 -28
  48. data/spec/app/models/mdm/vuln_ref_spec.rb +8 -10
  49. data/spec/app/models/mdm/vuln_spec.rb +24 -26
  50. data/spec/app/models/mdm/web_form_spec.rb +11 -13
  51. data/spec/app/models/mdm/web_page_spec.rb +19 -21
  52. data/spec/app/models/mdm/web_site_spec.rb +21 -23
  53. data/spec/app/models/mdm/web_vuln_spec.rb +63 -65
  54. data/spec/app/models/mdm/wmap_request_spec.rb +1 -3
  55. data/spec/app/models/mdm/wmap_target_spec.rb +1 -3
  56. data/spec/app/models/mdm/workspace_spec.rb +97 -100
  57. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +3 -5
  58. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +13 -15
  59. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +1 -3
  60. data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +1 -3
  61. data/spec/app/models/metasploit_data_models/ip_address/v4/cidr_spec.rb +10 -12
  62. data/spec/app/models/metasploit_data_models/ip_address/v4/nmap_spec.rb +4 -6
  63. data/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +21 -23
  64. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +9 -11
  65. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +21 -23
  66. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/segmented_spec.rb +4 -6
  67. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/single_spec.rb +22 -15
  68. data/spec/app/models/metasploit_data_models/ip_address/v4/single_spec.rb +4 -6
  69. data/spec/app/models/metasploit_data_models/module_run_spec.rb +1 -3
  70. data/spec/app/models/metasploit_data_models/search/operation/ip_address_spec.rb +18 -20
  71. data/spec/app/models/metasploit_data_models/search/operation/port/number_spec.rb +6 -8
  72. data/spec/app/models/metasploit_data_models/search/operation/port/range_spec.rb +8 -10
  73. data/spec/app/models/metasploit_data_models/search/operation/range_spec.rb +8 -10
  74. data/spec/app/models/metasploit_data_models/search/operator/ip_address_spec.rb +2 -4
  75. data/spec/app/models/metasploit_data_models/search/operator/multitext_spec.rb +8 -10
  76. data/spec/app/models/metasploit_data_models/search/operator/port/list_spec.rb +6 -8
  77. data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +9 -11
  78. data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +5 -7
  79. data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +17 -19
  80. data/spec/app/models/metasploit_data_models/search/visitor/method_spec.rb +5 -7
  81. data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +61 -23
  82. data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +8 -10
  83. data/spec/app/validators/parameters_validator_spec.rb +29 -29
  84. data/spec/app/validators/password_is_strong_validator_spec.rb +54 -46
  85. data/spec/dummy/db/structure.sql +1 -0
  86. data/spec/lib/base64_serializer_spec.rb +19 -19
  87. data/spec/lib/metasploit_data_models/ip_address/cidr_spec.rb +18 -12
  88. data/spec/lib/metasploit_data_models/ip_address/range_spec.rb +4 -6
  89. data/spec/lib/metasploit_data_models/match/child_spec.rb +2 -4
  90. data/spec/lib/metasploit_data_models/match/parent_spec.rb +4 -6
  91. data/spec/lib/metasploit_data_models/version_spec.rb +3 -5
  92. data/spec/spec_helper.rb +72 -6
  93. data/spec/support/shared/examples/mdm/module/detail/does_not_support_stance_with_mtype.rb +2 -2
  94. data/spec/support/shared/examples/mdm/module/detail/supports_stance_with_mtype.rb +4 -4
  95. data/spec/support/shared/examples/metasploit_data_models/search/operation/ipaddress/match.rb +2 -2
  96. data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_children.rb +5 -5
  97. data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_metasploit_model_search_operation_base.rb +5 -5
  98. data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb +3 -3
  99. data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_metasploit_model_search_group_base.rb +7 -6
  100. metadata +6 -6
@@ -6,7 +6,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
6
6
  end
7
7
 
8
8
  it 'should return true for supports_stance?' do
9
- detail.supports_stance?.should be_true
9
+ expect(detail.supports_stance?).to eq(true)
10
10
  end
11
11
 
12
12
  context 'with nil stance' do
@@ -14,7 +14,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
14
14
  nil
15
15
  end
16
16
 
17
- it { should be_invalid }
17
+ it { is_expected.to be_invalid }
18
18
  end
19
19
 
20
20
  context "with 'aggresive' stance" do
@@ -22,7 +22,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
22
22
  'aggressive'
23
23
  end
24
24
 
25
- it { should be_valid }
25
+ it { is_expected.to be_valid }
26
26
  end
27
27
 
28
28
  context "with 'passive' stance" do
@@ -30,7 +30,7 @@ shared_examples_for 'Mdm::Module::Detail supports stance with mtype' do |mtype|
30
30
  'passive'
31
31
  end
32
32
 
33
- it { should be_valid }
33
+ it { is_expected.to be_valid }
34
34
  end
35
35
  end
36
36
  end
@@ -11,7 +11,7 @@ shared_examples_for 'MetasploitDataModels::Search::Operation::IPAddress::*.match
11
11
 
12
12
  shared_examples_for 'match' do |boolean|
13
13
  if boolean
14
- it { should be_a described_class }
14
+ it { is_expected.to be_a described_class }
15
15
 
16
16
  it 'does not set #operator' do
17
17
  expect(match.operator).to be_nil
@@ -21,7 +21,7 @@ shared_examples_for 'MetasploitDataModels::Search::Operation::IPAddress::*.match
21
21
  expect(match.value).not_to be_nil
22
22
  end
23
23
  else
24
- it { should be_nil }
24
+ it { is_expected.to be_nil }
25
25
  end
26
26
  end
27
27
 
@@ -13,10 +13,10 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Includes#visit with
13
13
 
14
14
  it 'should visit each child' do
15
15
  # needed for call to visit subject
16
- visitor.should_receive(:visit).with(node).and_call_original
16
+ expect(visitor).to receive(:visit).with(node).and_call_original
17
17
 
18
18
  children.each do |child|
19
- visitor.should_receive(:visit).with(child).and_return([])
19
+ expect(visitor).to receive(:visit).with(child).and_return([])
20
20
  end
21
21
 
22
22
  visit
@@ -25,14 +25,14 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Includes#visit with
25
25
  it 'should return Array of all child visits' do
26
26
  child_visits = []
27
27
 
28
- visitor.should_receive(:visit).with(node).and_call_original
28
+ expect(visitor).to receive(:visit).with(node).and_call_original
29
29
 
30
30
  children.each_with_index do |child, i|
31
31
  child_visit = ["Visited Child #{i}"]
32
- visitor.stub(:visit).with(child).and_return(child_visit)
32
+ allow(visitor).to receive(:visit).with(child).and_return(child_visit)
33
33
  child_visits.concat(child_visit)
34
34
  end
35
35
 
36
- visit.should == child_visits
36
+ expect(visit).to eq(child_visits)
37
37
  end
38
38
  end
@@ -10,17 +10,17 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Includes#visit with
10
10
  end
11
11
 
12
12
  it 'should visit operator' do
13
- visitor.should_receive(:visit).with(node).and_call_original
14
- visitor.should_receive(:visit).with(operator).and_return([])
13
+ expect(visitor).to receive(:visit).with(node).and_call_original
14
+ expect(visitor).to receive(:visit).with(operator).and_return([])
15
15
 
16
16
  visit
17
17
  end
18
18
 
19
19
  it 'should return operator visit' do
20
20
  operator_visit = ["Visited Operator"]
21
- visitor.should_receive(:visit).with(node).and_call_original
22
- visitor.stub(:visit).with(operator).and_return(operator_visit)
21
+ expect(visitor).to receive(:visit).with(node).and_call_original
22
+ allow(visitor).to receive(:visit).with(operator).and_return(operator_visit)
23
23
 
24
- visit.should == operator_visit
24
+ expect(visit).to eq(operator_visit)
25
25
  end
26
26
  end
@@ -18,16 +18,16 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with equ
18
18
  end
19
19
 
20
20
  it 'should visit operation.operator with attribute_visitor' do
21
- visitor.attribute_visitor.should_receive(:visit).with(operator).and_call_original
21
+ expect(visitor.attribute_visitor).to receive(:visit).with(operator).and_call_original
22
22
 
23
23
  visit
24
24
  end
25
25
 
26
26
  it 'should call eq on Arel::Attributes::Attribute from attribute_visitor' do
27
27
  attribute = double('Visited Operator')
28
- visitor.attribute_visitor.stub(:visit).with(operator).and_return(attribute)
28
+ allow(visitor.attribute_visitor).to receive(:visit).with(operator).and_return(attribute)
29
29
 
30
- attribute.should_receive(:eq).with(value)
30
+ expect(attribute).to receive(:eq).with(value)
31
31
 
32
32
  visit
33
33
  end
@@ -16,22 +16,22 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with Met
16
16
  end
17
17
 
18
18
  it 'should visit each child' do
19
- visitor.should_receive(:visit).with(node).and_call_original
19
+ expect(visitor).to receive(:visit).with(node).and_call_original
20
20
 
21
21
  children.each do |child|
22
- visitor.should_receive(:visit).with(child).and_return(Arel::Nodes::Equality.new(1, 1))
22
+ expect(visitor).to receive(:visit).with(child).and_return(Arel::Nodes::Equality.new(1, 1))
23
23
  end
24
24
 
25
25
  visit
26
26
  end
27
27
 
28
28
  it "should combine children AREL with #{arel_class}" do
29
- visitor.stub(:visit).with(node).and_call_original
29
+ allow(visitor).to receive(:visit).with(node).and_call_original
30
30
  child_visits = []
31
31
 
32
32
  children.each_with_index do |child, i|
33
33
  child_visit = Arel::Nodes::Equality.new(i, i)
34
- visitor.stub(:visit).with(child).and_return(child_visit)
34
+ allow(visitor).to receive(:visit).with(child).and_return(child_visit)
35
35
  child_visits << child_visit
36
36
  end
37
37
 
@@ -43,8 +43,9 @@ shared_examples_for 'MetasploitDataModels::Search::Visitor::Where#visit with Met
43
43
  arel_pair = root
44
44
  end
45
45
 
46
- arel_pair.should be_a arel_class
46
+ expect(arel_pair).to be_a arel_class
47
47
 
48
- expect([arel_pair.left, arel_pair.right]).to match_array(child_visits)
48
+ expect(arel_pair.left).to eq(child_visits[0])
49
+ expect(arel_pair.right).to eq(child_visits[1])
49
50
  end
50
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.24.1.pre.rspec.pre.3.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Huckins
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-04-15 00:00:00.000000000 Z
14
+ date: 2015-05-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -123,14 +123,14 @@ dependencies:
123
123
  requirements:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
- version: 0.29.0
126
+ version: 0.30.1
127
127
  type: :runtime
128
128
  prerelease: false
129
129
  version_requirements: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - "~>"
132
132
  - !ruby/object:Gem::Version
133
- version: 0.29.0
133
+ version: 0.30.1
134
134
  - !ruby/object:Gem::Dependency
135
135
  name: railties
136
136
  requirement: !ruby/object:Gem::Requirement
@@ -636,9 +636,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
636
636
  version: '2.1'
637
637
  required_rubygems_version: !ruby/object:Gem::Requirement
638
638
  requirements:
639
- - - ">="
639
+ - - ">"
640
640
  - !ruby/object:Gem::Version
641
- version: '0'
641
+ version: 1.3.1
642
642
  requirements: []
643
643
  rubyforge_project:
644
644
  rubygems_version: 2.4.3