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.10.0 spec/ppl/command/ls_spec.rb
ppl-1.9.0 spec/ppl/command/ls_spec.rb
ppl-1.8.0 spec/ppl/command/ls_spec.rb
ppl-1.7.0 spec/ppl/command/ls_spec.rb
ppl-1.6.0 spec/ppl/command/ls_spec.rb
ppl-1.5.3 spec/ppl/command/ls_spec.rb
ppl-1.5.2 spec/ppl/command/ls_spec.rb
ppl-1.5.1 spec/ppl/command/ls_spec.rb
ppl-1.5.0 spec/ppl/command/ls_spec.rb
ppl-1.4.1 spec/ppl/command/ls_spec.rb
ppl-1.3.0 spec/ppl/command/ls_spec.rb
ppl-1.2.0 spec/ppl/command/ls_spec.rb
ppl-1.1.0 spec/ppl/command/ls_spec.rb
ppl-1.0.6 spec/ppl/command/ls_spec.rb
ppl-1.0.5 spec/ppl/command/ls_spec.rb
ppl-1.0.4 spec/ppl/command/ls_spec.rb
ppl-1.0.3 spec/ppl/command/ls_spec.rb
ppl-1.0.1 spec/ppl/command/ls_spec.rb
ppl-1.0.0 spec/ppl/command/ls_spec.rb
ppl-0.9.0 spec/ppl/command/ls_spec.rb