Skip to content

Commit

Permalink
[cli] first pass at test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Oct 20, 2011
1 parent 19930fb commit 58b9cd6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/bin/cli_tests.rb
@@ -0,0 +1,17 @@
Shindo.tests('cli_tests', 'cli') do

Thread.current[:formatador] = Formatador.new # reset indentation

EMPTY_SERVER_LISTING = Fog::Compute[:aws].servers.all.inspect + "\n"

empty_server_listing_implicit_arguments = 'aws:compute:servers --mock'
tests(empty_server_listing_implicit_arguments).returns(EMPTY_SERVER_LISTING) do
bin(empty_server_listing_implicit_arguments)
end

empty_server_listing_explicit_arguments = 'aws:compute:servers:all --mock'
tests(empty_server_listing_explicit_arguments).returns(EMPTY_SERVER_LISTING) do
bin(empty_server_listing_explicit_arguments)
end

end
8 changes: 8 additions & 0 deletions tests/bin/helper.rb
@@ -0,0 +1,8 @@
require 'fog'
require 'fog/bin' # for available_providers

BIN = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'fog'))

def bin(arguments)
`#{BIN} #{arguments}`
end

0 comments on commit 58b9cd6

Please sign in to comment.