Sha256: 5ccf5461911a3be1169cb45e56da5e0564a13c658254a96e758b6f10082d793c

Contents?: true

Size: 722 Bytes

Versions: 2

Compression:

Stored size: 722 Bytes

Contents

describe <%= project_class_name %>::CLI do
  before(:all) do
    @args = "--from Tung"
  end

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cli-template-4.0.2 lib/templates/default/spec/cli_spec.rb.tt
cli-template-4.0.1 lib/templates/default/spec/lib/cli_spec.rb.tt