Sha256: 636de090e583dd495e61496fbbcd0ea9d907661dd36094fb3b196cd2c6deb055

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

require "spec_helper"

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

1 entries across 1 versions & 1 rubygems

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