Sha256: 268a2c259d3ac26eebf8e63a6c385d23e34a90026e136a85bebd358d5947368a

Contents?: true

Size: 893 Bytes

Versions: 10

Compression:

Stored size: 893 Bytes

Contents

require "spec_helper"

RSpec.describe <%= configuration.project_namespaced_class %>::CLI::Shell do
  using Refinements::Pathnames
  using Infusible::Stub

  subject(:shell) { described_class.new }

  include_context "with application dependencies"

  before { Sod::Import.stub kernel:, logger: }

  after { Sod::Import.unstub :kernel, :logger }

  describe "#call" do
    it "prints configuration usage" do
      shell.call %w[config]
      expect(kernel).to have_received(:puts).with(/Manage configuration.+/m)
    end

    it "prints version" do
      shell.call %w[--version]
      expect(kernel).to have_received(:puts).with(/<%= configuration.project_label.gsub(" ", "\\s") %>\s\d+\.\d+\.\d+/)
    end

    it "prints help" do
      shell.call %w[--help]
      expect(kernel).to have_received(:puts).with(/<%= configuration.project_label.gsub(" ", "\\s") %>.+USAGE.+/m)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gemsmith-20.7.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.6.1 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.6.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.5.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.4.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.3.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.2.1 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.2.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.1.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
gemsmith-20.0.0 lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb