Sha256: 4e7cb709ae394256916ed3edf8eb88764ba6f2f5c9ab5afa154f989b8f8e6c36

Contents?: true

Size: 1.01 KB

Versions: 26

Compression:

Stored size: 1.01 KB

Contents

describe Ppl::Command::External do

  before(:each) do
    @command = Ppl::Command::External.new("remote", "git remote", "Execute 'git remote' in the address book directory")
    @input   = Ppl::Application::Input.new
    @output  = double(Ppl::Application::Output)
    @storage = double(Ppl::Adapter::Storage)

    @storage.stub(:path).and_return("/contacts")
    @command.storage = @storage
  end

  describe "#execute" do

    it "should chdir to the location of the address book on disk" do
      Dir.should_receive(:chdir).with("/contacts")
      Kernel.stub(:exec)
      @command.execute(@input, @output)
    end

    it "should run the specified command" do
      Dir.stub(:chdir)
      Kernel.should_receive(:exec).with("git remote")
      @command.execute(@input, @output)
    end

    it "should pass arguments through to the command" do
      @input.arguments = ["--help"]
      Dir.stub(:chdir)
      Kernel.should_receive(:exec).with("git remote --help")
      @command.execute(@input, @output)
    end

  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ppl-3.0.1 spec/ppl/command/external_spec.rb
ppl-3.0.0 spec/ppl/command/external_spec.rb
ppl-2.4.1 spec/ppl/command/external_spec.rb
ppl-2.4.0 spec/ppl/command/external_spec.rb
ppl-2.3.3 spec/ppl/command/external_spec.rb
ppl-2.3.2 spec/ppl/command/external_spec.rb
ppl-2.3.1 spec/ppl/command/external_spec.rb
ppl-2.3.0 spec/ppl/command/external_spec.rb
ppl-2.2.0 spec/ppl/command/external_spec.rb
ppl-2.1.0 spec/ppl/command/external_spec.rb
ppl-2.0.0 spec/ppl/command/external_spec.rb
ppl-1.25.0 spec/ppl/command/external_spec.rb
ppl-1.24.0 spec/ppl/command/external_spec.rb
ppl-1.23.0 spec/ppl/command/external_spec.rb
ppl-1.22.2 spec/ppl/command/external_spec.rb
ppl-1.22.1 spec/ppl/command/external_spec.rb
ppl-1.22.0 spec/ppl/command/external_spec.rb
ppl-1.21.0 spec/ppl/command/external_spec.rb
ppl-1.20.0 spec/ppl/command/external_spec.rb
ppl-1.19.0 spec/ppl/command/external_spec.rb