Sha256: 4ff00743a0eec0234b132baeb8d8c66e99b6cc8e45771ee87226320fb13b53e0

Contents?: true

Size: 1.43 KB

Versions: 31

Compression:

Stored size: 1.43 KB

Contents

Metasploit::Model::Spec.shared_examples_for 'Module::Target::Platform' do
  context 'factories' do
    context module_target_platform_factory do
      subject(module_target_platform_factory) do
        FactoryGirl.build(module_target_platform_factory)
      end

      it { should be_valid }

      context '#module_target' do
        subject(:module_target) do
          send(module_target_platform_factory).module_target
        end

        it { should be_valid }

        context '#module_instance' do
          subject(:module_instance) do
            module_target.module_instance
          end

          it { should be_valid }

          context '#targets' do
            subject(:targets) do
              module_instance.targets
            end

            its(:length) { should == 1 }

            it 'should include #module_target' do
              expect(targets).to include module_target
            end
          end
        end

        context '#target_platforms' do
          subject(:target_platforms) do
            module_target.target_platforms
          end

          its(:length) { should == 1}

          it "should include #{module_target_platform_factory}" do
            expect(target_platforms).to include send(module_target_platform_factory)
          end
        end
      end
    end
  end

  context 'validations' do
    it { should validate_presence_of :module_target }
    it { should validate_presence_of :platform }
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
metasploit-model-0.25.3 spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.25.3-java spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.25.2 spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.25.2-java spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.25.1 spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.25.1-java spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups-java spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.24.1-java spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.24.1 spec/support/shared/examples/metasploit/model/module/target/platform.rb
metasploit-model-0.24.1.pre.semantic.pre.versioning.pre.2.pre.0 spec/support/shared/examples/metasploit/model/module/target/platform.rb