Sha256: c5eba3f4f42bd5d4c545ebc5d9a36a664095dd706eb63696558e7f108c0a4ddd

Contents?: true

Size: 963 Bytes

Versions: 5

Compression:

Stored size: 963 Bytes

Contents

require 'vhost_generator/application'
require 'ostruct'

describe VhostGenerator::Application do
  describe "Options" do
    let(:config) { OpenStruct.new }
    before { subject.config = config }

    options = Hash[
      'application'       => %w(-a --application),
      'static_folder'     => %w(-f --static-folder),
      'server_ports'      => %w(-l --listen),
      'server_names'      => %w(-s --server-name),
      'instance_ports'    => %w(-p --instance-port),
      'relative_root'     => %w(-r --relative-root),
      'generator'         => %w(-g --generator),
      'generator_options' => %w(-o --generator-options)
    ]

    options.each_pair do |name, flags|
      describe "#{name} option" do
        flags.each do |flag|
          it "is set by the #{flag} flag" do
            expect {
              subject.handle_options([flag, 'value'])
            }.to change(config, name).to('value')
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vhost_generator-0.3.4 spec/application_options_spec.rb
vhost_generator-0.3.3 spec/application_options_spec.rb
vhost_generator-0.3.2 spec/application_options_spec.rb
vhost_generator-0.3.1 spec/application_options_spec.rb
vhost_generator-0.3.0 spec/application_options_spec.rb