opscode/knife-cloud — pull request #2 by ameyavarade (2013-06-12 13:57:41+00:00)
Title: Knife cloud test utils

Opening a PR for review.
This branch is re-based with undergoing development of knife cloud and contains changes for knife cloud test utility.

To use this library user will have to update the spec_helper with

require 'rspec/knife-cloud/test_bed'

and, include the required modules (include KnifeTestBed, include RSpec::KnifeTestUtils) in the respective describe block. init_test should be called to create test bed and cleanup_test_data for cleaning up the test data. for instance;

describe 'knife-vcloud' do

include KnifeTestBed
include RSpec::KnifeTestUtils
before(:all) { init_test }
after(:all) { cleanup_test_data }

#Example Tests followed
context 'gem' do

context 'build' do
let(:command) { "gem build knife-vcloud.gemspec" }
it 'should succeed' do
match_status("should succeed")
end
end

context 'install ' do
let(:command) { "gem install " + get_gem_file_name }
it 'should succeed' do
match_status("should succeed")
end
end

end
end