Sha256: d8033e5d40369df7fbd0b3171b99c24f0c6179faeb8c1cf33b340190994eed6c

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require "spec_helper"

describe Codebuild::CLI do
  before(:all) do
    @args = "--from Tung"
  end

  describe "codebuild" do
    it "hello" do
      out = execute("exe/codebuild hello world #{@args}")
      expect(out).to include("from: Tung\nHello world")
    end

    it "goodbye" do
      out = execute("exe/codebuild sub goodbye world #{@args}")
      expect(out).to include("from: Tung\nGoodbye world")
    end

    commands = {
      "hell" => "hello",
      "hello" => "name",
      "hello -" =>  "--from",
      "hello name" => "--from",
      "hello name --" => "--from",
      "sub goodb" => "goodbye",
      "sub goodbye" => "name",
      "sub goodbye name" => "--from",
      "sub goodbye name --" => "--from",
      "sub goodbye name --from" => "--help",
    }
    commands.each do |command, expected_word|
      it "completion #{command}" do
        out = execute("exe/codebuild completion #{command}")
        expect(out).to include(expected_word) # only checking for one word for simplicity
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codebuild-0.1.0 spec/lib/cli_spec.rb