Sha256: 7e4d2d0ef5f50577aafbf01d53deb941d531d0505b715d3723712e09ef746807

Contents?: true

Size: 821 Bytes

Versions: 1

Compression:

Stored size: 821 Bytes

Contents

describe CLIForge::Configuration, "#remove_command" do

  it "should remove the command" do
    command = double("TestCommand")
    subject.register_command(:foo, command)
    subject.remove_command(:foo)

    expect(subject.embedded_commands[:foo]).to eq(nil)
  end

  it "should not freak out if the command doesn't exist" do
    expect(subject.embedded_commands[:bar]).to eq(nil)

    subject.remove_command(:bar)

    expect(subject.embedded_commands[:bar]).to eq(nil)
  end

  it "should coerce string names to symbols" do
    expect(subject.embedded_commands[:bar]).to eq(nil)

    command = double("TestCommand")
    subject.register_command(:bar, command)
    subject.remove_command("bar")

    expect(subject.embedded_commands[:bar]).to eq(nil)
    expect(subject.embedded_commands["bar"]).to eq(nil)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cli-forge-0.1.0 spec/unit/cli_forge/configuration/remove_command_spec.rb