Sha256: e90f664b92c7cc3996b70307c6164959a4d914b9731a7e33b6aba5f7b4998952

Contents?: true

Size: 743 Bytes

Versions: 1

Compression:

Stored size: 743 Bytes

Contents

require_relative '../spec_helper'

describe Rhinestone::Config do
  it "parses out cache_path from arguments in long version" do
    config('-d --environment prod --cache-path /some/path -p 80').should == {
      :cache_path => '/some/path'
    }
  end

  it "parses out cache_path from arguments in short version" do
    config('-d --environment prod -C /some/path -p 80').should == {
      :cache_path => '/some/path'
    }
  end

  it 'removes the option from argv' do
    args = argv('-p --cache-path /foo -D')

    Rhinestone::Config.new(args).to_h

    args.should == ['-p', '-D']
  end

  def config(command_line)
    Rhinestone::Config.new(argv(command_line)).to_h
  end

  def argv(command_line)
    command_line.split(' ')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhinestone-0.0.2 spec/rhinestone/config_spec.rb