Sha256: 778b1aad0649133bbb1f6225000afd14de8089e258d55d613304788d13394fa3

Contents?: true

Size: 1.08 KB

Versions: 31

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe Metasploit::Model::Authority::Waraxe do
  context 'CONSTANTS' do
    context 'DESIGNATION_REGEXP' do
      subject(:designation_regexp) do
        described_class::DESIGNATION_REGEXP
      end

      let(:designation) do
        FactoryGirl.generate :metasploit_model_reference_waraxe_designation
      end

      it 'should match sequence' do
        designation.should match(designation_regexp)
      end
    end
  end

  context 'designation_url' do
    subject(:designation_url) do
      described_class.designation_url(designation)
    end

    context 'with designation that matches DESIGNATION_URL' do
      let(:designation) do
        "#{year}-SA##{number}"
      end

      let(:number) do
        103
      end

      let(:year) do
        2013
      end

      it 'should be under bid directory' do
        designation_url.should == "http://www.waraxe.us/advisory-#{number}.html"
      end
    end

    context 'without designation that matches DESIGNATION_URL' do
      let(:designation) do
        '#103'
      end

      it { should be_nil }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
metasploit-model-0.25.3 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.3-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.2 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.2-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.1 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.1-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.24.1-java spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.24.1 spec/lib/metasploit/model/authority/waraxe_spec.rb
metasploit-model-0.24.1.pre.semantic.pre.versioning.pre.2.pre.0 spec/lib/metasploit/model/authority/waraxe_spec.rb