Permalink
Browse files

Switched the Cli class to use Status now that it in turn wraps the Pa…

…rser class
  • Loading branch information...
1 parent d966c21 commit 9d7e201e7412b3f41c11cff493f623f94498d5ad James Ottaway committed Apr 9, 2012
Showing with 5 additions and 4 deletions.
  1. +3 −3 lib/billd/cli.rb
  2. +2 −1 spec/billd/cli_spec.rb
View
@@ -1,11 +1,11 @@
-require 'billd/parser'
+require 'billd/status'
module Billd
class Cli
def self.execute args
uri = args.shift
- builds = Billd::Parser.parse(uri)
- STDOUT.puts builds.map { |build| build.to_s }.join "\n"
+ status = Billd::Status.new(uri)
+ STDOUT.puts status.builds.map { |build| build.to_s }.join "\n"
end
end
end
@@ -6,8 +6,9 @@
let(:build_output) { 'i am a build' }
let(:argv) { [uri] }
let(:build) { mock 'Build', :to_s => build_output }
+ let(:status) { mock 'Status', :builds => [build] }
- before { Billd::Parser.should_receive(:parse).with(uri).and_return([build]) }
+ before { Billd::Status.should_receive(:new).with(uri).and_return(status) }
before { STDOUT.should_receive(:puts).with(build_output) }
it { Billd::Cli.execute(argv) }

0 comments on commit 9d7e201

Please sign in to comment.