Parent

Included Modules

Object

Public Instance Methods

check_key(the_key, key_name = "") click to toggle source
# File specs/keys_spec.rb, line 21
def check_key(the_key, key_name = "")
  the_key.should_not be_nil
  the_key.id.should be_a(String)
  the_key.id.should eql(key_name)
  the_key.actions.should_not be_nil
  the_key.actions.size.should eql(1)
  the_key.actions.first[0].should eql("destroy")
  the_key.actions.first[1].should eql("#{API_URL}/keys/#{key_name}")
  the_key.fingerprint.should_not be_nil
  the_key.fingerprint.should be_a(String)
  the_key.pem.should_not be_nil
  the_key.pem.first.should be_a(String)
end
clean_fixtures() click to toggle source
# File specs/spec_helper.rb, line 43
def clean_fixtures
  FileUtils.rm_rf( File.dirname( __FILE__ ) + '/data' )
end
client() click to toggle source
# File specs/content_spec.rb, line 21
def client
  RestClient::Resource.new(API_URL)
end
create_key_if_necessary(client, key_name) click to toggle source
# File specs/keys_spec.rb, line 35
def create_key_if_necessary(client, key_name)
  the_key = client.key(key_name)
  unless the_key
    client.create_key()
  end
end
headers(header) click to toggle source
# File specs/content_spec.rb, line 25
def headers(header)
  encoded_credentials = ["#{API_NAME}:#{API_PASSWORD}"].pack("m0").gsub(/\n/,'')
  { :authorization => "Basic " + encoded_credentials }.merge(header)
end
includes_transition( transitions, action, to ) click to toggle source
# File specs/instance_states_spec.rb, line 74
def includes_transition( transitions, action, to )
  found = transitions.find{|e| e.action.to_s == action.to_s && e.to.to_s == to.to_s }
  ! found.nil?
end
invalid_usage(error_msg='') click to toggle source
# File bin/deltacloudc, line 81
def invalid_usage(error_msg='')
  puts "\n ERROR: #{error_msg} \n\n"
  puts @optparse
  exit(1)
end
prop_check(prop, value_class) click to toggle source
# File specs/hardware_profiles_spec.rb, line 22
def prop_check(prop, value_class)
  if prop.present?
    prop.value.should_not be_nil
    prop.value.should be_a(value_class)
  end
end
reload_fixtures() click to toggle source
# File specs/spec_helper.rb, line 47
def reload_fixtures
  clean_fixtures
  FileUtils.cp_r( File.dirname( __FILE__) + '/fixtures', File.dirname( __FILE__ ) + '/data' )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.