Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
MSP-9228
  • Loading branch information
limhoff-r7 committed Jan 24, 2014
1 parent 04f0cf0 commit 11e8796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
2 changes: 1 addition & 1 deletion lib/metasploit_data_models/version.rb
Expand Up @@ -4,5 +4,5 @@ module MetasploitDataModels
# metasploit-framework/data/sql/migrate to db/migrate in this project, not all models have specs that verify the
# migrations (with have_db_column and have_db_index) and certain models may not be shared between metasploit-framework
# and pro, so models may be removed in the future. Because of the unstable API the version should remain below 1.0.0
VERSION = '0.59.0'
VERSION = '0.59.1'
end
46 changes: 2 additions & 44 deletions spec/app/models/mdm/module/instance_spec.rb
Expand Up @@ -381,48 +381,6 @@
end
end

context 'payloads' do
subject(:payloads) do
described_class.payloads
end

#
# let!s
#

let!(:module_class_by_module_type) do
Metasploit::Model::Module::Type::ALL.each_with_object({}) { |module_type, module_class_by_module_type|
module_class = FactoryGirl.create(
:mdm_module_class,
module_type: module_type
)

module_class_by_module_type[module_type] = module_class
}
end

let!(:module_instance_by_module_type) do
module_class_by_module_type.each_with_object({}) { |(module_type, module_class), module_instance_by_module_type|
module_instance = FactoryGirl.create(
:mdm_module_instance,
module_class: module_class
)

module_instance_by_module_type[module_type] = module_instance
}
end

it 'includes payload' do
expect(payloads).to include(module_instance_by_module_type['payload'])
end

Metasploit::Model::Module::Type::NON_PAYLOAD.each do |module_type|
it "does not include #{module_type}" do
expect(payloads).not_to include(module_instance_by_module_type[module_type])
end
end
end

context 'payloads_compatible_with' do
subject(:payloads_compatible_with) do
described_class.payloads_compatible_with(module_target)
Expand Down Expand Up @@ -496,8 +454,8 @@
module_target.save!
end

it 'calls payloads' do
expect(described_class).to receive(:payloads).and_call_original
it "calls with_module_type('payload')" do
expect(described_class).to receive(:with_module_type).with('payload').and_call_original

payloads_compatible_with
end
Expand Down

0 comments on commit 11e8796

Please sign in to comment.