Sha256: 393cfa4a2679d2239f131c65d55eadabe7ae7607bbedd42b727bbd5e71af5ea1

Contents?: true

Size: 716 Bytes

Versions: 32

Compression:

Stored size: 716 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'
require 'magellan/cli/script'

describe Magellan::Cli do
  describe "cli" do
    it "pass args to Magellan::Cli::Command.start" do
      expect(Magellan::Cli::Command).to receive(:start).with(%w[foo bar])
      cli %w[foo bar]
    end

    it "parse args" do
      expect(Magellan::Cli::Command).to receive(:start).with(%w[foo bar])
      cli "foo bar"
    end

    it "parse args with space in quotation" do
      expect(Magellan::Cli::Command).to receive(:start).with(["foo bar"])
      cli '"foo bar"'
    end

    it "parse args with space escaped" do
      expect(Magellan::Cli::Command).to receive(:start).with(["foo bar"])
      cli 'foo\ bar'
    end
  end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
magellan-cli-0.7.10 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.9 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.8 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.7 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.6 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.5 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.4 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.3 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.2 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.1 spec/magellan/cli/script_spec.rb
magellan-cli-0.7.0 spec/magellan/cli/script_spec.rb
magellan-cli-0.6.5 spec/magellan/cli/script_spec.rb
magellan-cli-0.6.4 spec/magellan/cli/script_spec.rb
magellan-cli-0.6.3 spec/magellan/cli/script_spec.rb
magellan-cli-0.6.2 spec/magellan/cli/script_spec.rb
magellan-cli-0.6.1 spec/magellan/cli/script_spec.rb
magellan-cli-0.6.0 spec/magellan/cli/script_spec.rb
magellan-cli-0.5.9 spec/magellan/cli/script_spec.rb
magellan-cli-0.5.8 spec/magellan/cli/script_spec.rb
magellan-cli-0.5.7 spec/magellan/cli/script_spec.rb