Sha256: 52c0f7a28a356d5c53ee60f39671604a638d24666f7662f8371639eb3cf266b5

Contents?: true

Size: 790 Bytes

Versions: 4

Compression:

Stored size: 790 Bytes

Contents

require 'spec_helper'

describe CMSScanner::Controller do
  subject(:controller) { described_class::Base.new }

  context 'when parsed_options' do
    before { described_class::Base.parsed_options = parsed_options }

    let(:parsed_options) { { url: 'http://example.com/' } }

    its(:parsed_options)        { should eq(parsed_options) }
    its(:formatter)             { should be_a CMSScanner::Formatter::Cli }
    its(:target)                { should be_a CMSScanner::Target }
    its('target.scope.domains') { should eq [PublicSuffix.parse('example.com')] }

    describe '#render' do
      it 'calls the formatter#render' do
        expect(controller.formatter).to receive(:render).with('test', { verbose: nil }, 'base')
        controller.render('test')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cms_scanner-0.0.14 spec/lib/controller_spec.rb
cms_scanner-0.0.13 spec/lib/controller_spec.rb
cms_scanner-0.0.12 spec/lib/controller_spec.rb
cms_scanner-0.0.11 spec/lib/controller_spec.rb