mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
setting up other two libraries for mocking
This commit is contained in:
parent
bbdf8ee759
commit
3c21f15cb9
4 changed files with 122 additions and 1 deletions
23
Rakefile
23
Rakefile
|
@ -1,6 +1,9 @@
|
|||
require 'rubygems'
|
||||
require 'rake'
|
||||
|
||||
current_directory = File.dirname(__FILE__)
|
||||
require "#{current_directory}/lib/fog"
|
||||
|
||||
begin
|
||||
require 'jeweler'
|
||||
Jeweler::Tasks.new do |gem|
|
||||
|
@ -20,6 +23,7 @@ end
|
|||
require 'spec/rake/spectask'
|
||||
Spec::Rake::SpecTask.new(:spec) do |spec|
|
||||
spec.libs << 'lib' << 'spec'
|
||||
spec.spec_opts = ['-c']
|
||||
spec.spec_files = FileList['spec/**/*_spec.rb']
|
||||
end
|
||||
|
||||
|
@ -29,7 +33,24 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
|
|||
spec.rcov = true
|
||||
end
|
||||
|
||||
task :default => :spec
|
||||
namespace :specs do
|
||||
|
||||
task :with_mocking do
|
||||
Fog.mocking = true
|
||||
Rake::Task[:spec].invoke
|
||||
end
|
||||
|
||||
task :without_mocking do
|
||||
Fog.mocking = true
|
||||
Rake::Task[:spec].invoke
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
desc 'Run specs with and without mocking'
|
||||
task :specs => %w[ specs:with_mocking specs:without_mocking ]
|
||||
|
||||
task :default => :specs
|
||||
|
||||
require 'rake/rdoctask'
|
||||
Rake::RDocTask.new do |rdoc|
|
||||
|
|
|
@ -3,6 +3,7 @@ require 'base64'
|
|||
require 'cgi'
|
||||
require 'digest/md5'
|
||||
require 'hmac-sha1'
|
||||
require 'hmac-sha2'
|
||||
require 'mime/types'
|
||||
|
||||
current_directory = File.dirname(__FILE__)
|
||||
|
@ -16,7 +17,9 @@ module Fog
|
|||
def self.reload
|
||||
current_directory = File.dirname(__FILE__)
|
||||
load "#{current_directory}/aws/ec2.rb"
|
||||
Fog::AWS::EC2.reload
|
||||
load "#{current_directory}/aws/simpledb.rb"
|
||||
Fog::AWS::SimpleDB.reload
|
||||
load "#{current_directory}/aws/s3.rb"
|
||||
Fog::AWS::S3.reload
|
||||
end
|
||||
|
|
|
@ -72,6 +72,78 @@ module Fog
|
|||
module AWS
|
||||
class EC2
|
||||
|
||||
def self.reload
|
||||
current_directory = File.dirname(__FILE__)
|
||||
load "#{current_directory}/../connection.rb"
|
||||
load "#{current_directory}/../parser.rb"
|
||||
load "#{current_directory}/../response.rb"
|
||||
|
||||
parsers_directory = "#{current_directory}/parsers/ec2"
|
||||
load "#{parsers_directory}/allocate_address.rb"
|
||||
load "#{parsers_directory}/attach_volume.rb"
|
||||
load "#{parsers_directory}/basic.rb"
|
||||
load "#{parsers_directory}/create_key_pair.rb"
|
||||
load "#{parsers_directory}/create_snapshot.rb"
|
||||
load "#{parsers_directory}/create_volume.rb"
|
||||
load "#{parsers_directory}/describe_addresses.rb"
|
||||
load "#{parsers_directory}/describe_availability_zones.rb"
|
||||
load "#{parsers_directory}/describe_images.rb"
|
||||
load "#{parsers_directory}/describe_instances.rb"
|
||||
load "#{parsers_directory}/describe_key_pairs.rb"
|
||||
load "#{parsers_directory}/describe_regions.rb"
|
||||
load "#{parsers_directory}/describe_security_groups.rb"
|
||||
load "#{parsers_directory}/describe_snapshots.rb"
|
||||
load "#{parsers_directory}/describe_volumes.rb"
|
||||
load "#{parsers_directory}/detach_volume.rb"
|
||||
load "#{parsers_directory}/get_console_output.rb"
|
||||
load "#{parsers_directory}/run_instances.rb"
|
||||
load "#{parsers_directory}/terminate_instances.rb"
|
||||
|
||||
requests_directory = "#{current_directory}/requests/ec2"
|
||||
load "#{requests_directory}/allocate_address.rb"
|
||||
load "#{requests_directory}/associate_address.rb"
|
||||
load "#{requests_directory}/attach_volume.rb"
|
||||
load "#{requests_directory}/authorize_security_group_ingress.rb"
|
||||
# TODO: require "#{requests_directory}/bundle_instance.rb"
|
||||
# TODO: require "#{requests_directory}/cancel_bundle_task.rb"
|
||||
# TODO: require "#{requests_directory}/confirm_product_instance.rb"
|
||||
load "#{requests_directory}/create_key_pair.rb"
|
||||
load "#{requests_directory}/create_security_group.rb"
|
||||
load "#{requests_directory}/create_snapshot.rb"
|
||||
load "#{requests_directory}/create_volume.rb"
|
||||
load "#{requests_directory}/delete_key_pair.rb"
|
||||
load "#{requests_directory}/delete_security_group.rb"
|
||||
load "#{requests_directory}/delete_snapshot.rb"
|
||||
load "#{requests_directory}/delete_volume.rb"
|
||||
# TODO: require "#{requests_directory}/deregister_image.rb"
|
||||
load "#{requests_directory}/describe_addresses.rb"
|
||||
load "#{requests_directory}/describe_availability_zones.rb"
|
||||
# TODO: require "#{requests_directory}/describe_bundle_tasks.rb"
|
||||
# TODO: require "#{requests_directory}/describe_image_attribute.rb"
|
||||
load "#{requests_directory}/describe_images.rb"
|
||||
load "#{requests_directory}/describe_instances.rb"
|
||||
load "#{requests_directory}/describe_key_pairs.rb"
|
||||
load "#{requests_directory}/describe_regions.rb"
|
||||
# TODO: require "#{requests_directory}/describe_reserved_instances.rb"
|
||||
# TODO: require "#{requests_directory}/describe_reserved_instances_offerings.rb"
|
||||
load "#{requests_directory}/describe_security_groups.rb"
|
||||
load "#{requests_directory}/describe_snapshots.rb"
|
||||
load "#{requests_directory}/describe_volumes.rb"
|
||||
load "#{requests_directory}/detach_volume.rb"
|
||||
load "#{requests_directory}/disassociate_address.rb"
|
||||
load "#{requests_directory}/get_console_output.rb"
|
||||
# TODO: require "#{requests_directory}/modify_image_attribute.rb"
|
||||
# TODO: require "#{requests_directory}/monitor_instances.rb"
|
||||
# TODO: require "#{requests_directory}/purchase_reserved_instances_offering.rb"
|
||||
load "#{requests_directory}/reboot_instances.rb"
|
||||
# TODO: require "#{requests_directory}/register_image.rb"
|
||||
load "#{requests_directory}/release_address.rb"
|
||||
load "#{requests_directory}/revoke_security_group_ingress.rb"
|
||||
load "#{requests_directory}/run_instances.rb"
|
||||
load "#{requests_directory}/terminate_instances.rb"
|
||||
# TODO: require "#{requests_directory}/unmonitor_instances.rb"
|
||||
end
|
||||
|
||||
# Initialize connection to EC2
|
||||
#
|
||||
# ==== Notes
|
||||
|
|
|
@ -25,6 +25,31 @@ module Fog
|
|||
module AWS
|
||||
class SimpleDB
|
||||
|
||||
def self.reload
|
||||
current_directory = File.dirname(__FILE__)
|
||||
load "#{current_directory}/../connection.rb"
|
||||
load "#{current_directory}/../parser.rb"
|
||||
load "#{current_directory}/../response.rb"
|
||||
|
||||
parsers_directory = "#{current_directory}/parsers/simpledb"
|
||||
load "#{parsers_directory}/basic.rb"
|
||||
load "#{parsers_directory}/domain_metadata.rb"
|
||||
load "#{parsers_directory}/get_attributes.rb"
|
||||
load "#{parsers_directory}/list_domains.rb"
|
||||
load "#{parsers_directory}/select.rb"
|
||||
|
||||
requests_directory = "#{current_directory}/requests/simpledb"
|
||||
load "#{requests_directory}/batch_put_attributes.rb"
|
||||
load "#{requests_directory}/create_domain.rb"
|
||||
load "#{requests_directory}/delete_attributes.rb"
|
||||
load "#{requests_directory}/delete_domain.rb"
|
||||
load "#{requests_directory}/domain_metadata.rb"
|
||||
load "#{requests_directory}/get_attributes.rb"
|
||||
load "#{requests_directory}/list_domains.rb"
|
||||
load "#{requests_directory}/put_attributes.rb"
|
||||
load "#{requests_directory}/select.rb"
|
||||
end
|
||||
|
||||
# Initialize connection to SimpleDB
|
||||
#
|
||||
# ==== Notes
|
||||
|
|
Loading…
Reference in a new issue