Skip to content

Commit

Permalink
Started on the integration tests
Browse files Browse the repository at this point in the history
Completed Appliance integration tests
Removed the old unit tests ( No longer applicable )
TODO: Make the tests work on rake test. Doesn't seem to work when I just put the test in the test/ directory.
  • Loading branch information
rjsvaljean committed Jul 28, 2011
1 parent c38e64e commit 0023ce1
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 252 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -19,3 +19,6 @@ pkg

# gnome backup files
*~

# test config file
test/test_config.yaml
3 changes: 3 additions & 0 deletions Gemfile.lock
Expand Up @@ -10,6 +10,8 @@ GEM
activesupport (= 3.0.0)
activesupport (3.0.0)
builder (2.1.2)
fast_context (1.0.0)
shoulda
git (1.2.5)
i18n (0.4.1)
jeweler (1.6.0)
Expand All @@ -31,6 +33,7 @@ PLATFORMS

DEPENDENCIES
bundler (~> 1.0.0)
fast_context (>= 1.0.0)
jeweler (~> 1.6.0)
mocha
rcov
Expand Down
7 changes: 7 additions & 0 deletions lib/handlers/all.rb
Expand Up @@ -20,6 +20,13 @@ def initialize(*args)
connect(options.username, options.password, optional_connection_options)
@not_local= true if options.remote?
end

no_tasks do
def say(*args)
super(*args)
args[0]
end
end
end
end
end
Expand Down
14 changes: 8 additions & 6 deletions lib/handlers/appliance.rb
Expand Up @@ -37,12 +37,14 @@ def info
desc "appliance destroy", "destroy the current appliance (within appliance directory only)"
require_appliance_id
def destroy
if appliance.destroy.code_type == Net::HTTPOK
say 'Appliance Successfully Destroyed', :red
else
say_array ['There was a problem with destroying the appliance.',
'Make sure that you\'re in the appliance directory OR',
'Have provided the --appliance_id option']
require_appliance do |appliance|
if appliance.destroy.code_type == Net::HTTPOK
say 'Appliance Successfully Destroyed', :red
else
say_array ['There was a problem with destroying the appliance.',
'Make sure that you\'re in the appliance directory OR',
'Have provided the --appliance_id option']
end
end
end

Expand Down
1 change: 1 addition & 0 deletions lib/handlers/helper.rb
Expand Up @@ -70,6 +70,7 @@ def say_array(array, color= nil)
else
say "\n"
end
array
end

def require_appliance
Expand Down
20 changes: 0 additions & 20 deletions test/handlers/test_appliance.rb

This file was deleted.

45 changes: 0 additions & 45 deletions test/handlers/test_helper.rb

This file was deleted.

20 changes: 0 additions & 20 deletions test/handlers/test_repository.rb

This file was deleted.

27 changes: 0 additions & 27 deletions test/handlers/test_template.rb

This file was deleted.

6 changes: 6 additions & 0 deletions test/helper.rb
Expand Up @@ -10,10 +10,16 @@
require 'test/unit'
require 'shoulda'
require 'mocha'
require 'yaml'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'ssc'


class Test::Unit::TestCase
# You'll need to create this file(test/test_config.yaml) before you run the tests
TEST_CONFIG= YAML::load(File.read(File.join(File.dirname(__FILE__), 'test_config.yaml')))
APPLIANCES_CREATED= []
end
55 changes: 0 additions & 55 deletions test/test_argument_parser.rb

This file was deleted.

40 changes: 0 additions & 40 deletions test/test_directory_manager.rb

This file was deleted.

39 changes: 0 additions & 39 deletions test/test_ssc.rb

This file was deleted.

0 comments on commit 0023ce1

Please sign in to comment.