Sha256: 8de717d09b5b6efdf1cbeded0801ac6f2841773d5195d709127c382b82f304d8

Contents?: true

Size: 852 Bytes

Versions: 40

Compression:

Stored size: 852 Bytes

Contents

describe Ppl::Command::Ls do

  before(:each) do
    @command = Ppl::Command::Ls.new
    @input   = Ppl::Application::Input.new
    @output  = double(Ppl::Application::Output)
    @storage = double(Ppl::Adapter::Storage)
    @format  = double(Ppl::Format::AddressBook)
    @address_book = double(Ppl::Entity::AddressBook)

    @command.format   = @format
    @command.storage  = @storage
  end

  describe "#name" do
    it "should be 'ls'" do
      @command.name.should eq "ls"
    end
  end

  describe "#execute" do
    it "should show the list of contacts in the address book" do
      @storage.should_receive(:load_address_book).and_return(@address_book)
      @format.should_receive(:process).and_return("list of contacts")
      @output.should_receive(:line).with("list of contacts")
      @command.execute(@input, @output)
    end
  end

end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
ppl-1.24.0 spec/ppl/command/ls_spec.rb
ppl-1.23.0 spec/ppl/command/ls_spec.rb
ppl-1.22.2 spec/ppl/command/ls_spec.rb
ppl-1.22.1 spec/ppl/command/ls_spec.rb
ppl-1.22.0 spec/ppl/command/ls_spec.rb
ppl-1.21.0 spec/ppl/command/ls_spec.rb
ppl-1.20.0 spec/ppl/command/ls_spec.rb
ppl-1.19.0 spec/ppl/command/ls_spec.rb
ppl-1.18.0 spec/ppl/command/ls_spec.rb
ppl-1.17.2 spec/ppl/command/ls_spec.rb
ppl-1.17.1 spec/ppl/command/ls_spec.rb
ppl-1.17.0 spec/ppl/command/ls_spec.rb
ppl-1.16.0 spec/ppl/command/ls_spec.rb
ppl-1.15.1 spec/ppl/command/ls_spec.rb
ppl-1.15.0 spec/ppl/command/ls_spec.rb
ppl-1.14.1 spec/ppl/command/ls_spec.rb
ppl-1.14.0 spec/ppl/command/ls_spec.rb
ppl-1.13.0 spec/ppl/command/ls_spec.rb
ppl-1.12.0 spec/ppl/command/ls_spec.rb
ppl-1.11.0 spec/ppl/command/ls_spec.rb