source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/controller_support/permitted_parameters_test.rb | Ruby | apache-2.0 | 304 | main | 9,514 | # frozen_string_literal: true
require_relative "../../test_helper"
require "stronger_parameters/controller_support/permitted_parameters"
SingleCov.covered!
class WhitelistsController < ActionController::Base
ROUTES = ActionDispatch::Routing::RouteSet.new
ROUTES.draw { resources :whitelists }
include ROUTES.url... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/enumeration_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 587 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "enum parameter constraints" do
subject { ActionController::Parameters.enumeration("abc", 123) }
permits "abc"
permits 123
rejects "abcd"
rejects "123"
rejects 1234
rejects nil
describe "#==" do
it "... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/hex_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 335 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "hexadecimal parameter constraints" do
subject { ActionController::Parameters.hex }
permits "DEADbeef"
permits "abcdef0123456789"
rejects "abcxyz"
rejects ""
rejects 123
rejects false
rejects [1]
reject... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/date_iso8601_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 743 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "date_iso8601 parameter constraints" do
subject { ActionController::Parameters.date_iso8601 }
permits "2018-04-12", as: Date.iso8601("2018-04-12")
permits "2018-04-12T08:53:18+00:00", as: Date.iso8601("2018-04-12T08... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/date_time_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 518 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "datetime parameter constraints" do
subject { ActionController::Parameters.datetime }
permits DateTime.parse("2015-03-31"), as: DateTime.parse("2015-03-31")
permits "2015-03-31", as: DateTime.parse("2015-03-31")
p... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/integer_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 384 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "integer parameter constraints" do
subject { ActionController::Parameters.integer }
permits 123
permits 2**64
permits "123", as: 123
permits "-123", as: -123
permits " 123", as: 123
rejects "abc"
rejects ... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/date_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 494 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "date parameter constraints" do
subject { ActionController::Parameters.date }
permits Date.parse("2015-03-21"), as: Date.parse("2015-03-21")
permits "2015-03-31", as: Date.parse("2015-03-31")
permits "2015-03-31T1... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/comparison_constraints_test.rb | Ruby | apache-2.0 | 304 | main | 1,232 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe StrongerParameters::ComparisonConstraints do
subject { StrongerParameters::ComparisonConstraints.new(2) }
describe "#value" do
it "warns users that it should not be used" do
assert_raises(NotImplementedError... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/regexp_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 727 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "regexp parameter constraints" do
subject { ActionController::Parameters.regexp(/\Aab?c\Z/) }
permits "abc"
permits "ac"
rejects 123
rejects nil
rejects "abbc"
it "rejects non-strings with string constrain... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/file_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 440 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "io parameter constraints" do
subject { ActionController::Parameters.file }
permits StringIO.new("test")
permits File.new(".")
permits Rack::Test::UploadedFile.new("./README.md")
permits ActionDispatch::Http::Up... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/string_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 1,265 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe StrongerParameters::StringConstraint do
subject { ActionController::Parameters.string }
permits "abc"
rejects 123
rejects Date.today
rejects Time.now
rejects nil
rejects (+"\xA1").force_encoding("UTF-8")
... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/decimal_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 1,562 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "decimal parameter constraints" do
describe "with 2 scale and 4 precision" do
subject { ActionController::Parameters.decimal(4, 2) }
permits "1.23", as: 1.23
permits "-1.23", as: -1.23
permits 1.23
p... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/boolean_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 504 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "boolean parameter constraints" do
subject { ActionController::Parameters.boolean }
permits true, as: true
permits "true", as: true
permits "True", as: true
permits 1, as: true
permits "1", as: true
permits ... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/float_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 388 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "float parameter constraints" do
subject { ActionController::Parameters.float }
permits "1.2", as: 1.2
permits "-1.2", as: -1.2
permits 1.2
permits(-1.2)
rejects 1
rejects "1"
rejects "-1"
rejects "abc"... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/hash_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 2,479 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe StrongerParameters::HashConstraint do
def self.permits(value, as: value)
as = as.with_indifferent_access
super
end
subject do
ActionController::Parameters.map(
id: ActionController::Parameters.int... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/date_time_iso8601_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 775 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "datetime_iso8601 parameter constraints" do
subject { ActionController::Parameters.datetime_iso8601 }
permits "2018-04-12", as: DateTime.iso8601("2018-04-12")
permits "2018-04-12T08:53:18+00:00", as: DateTime.iso860... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/nil_string_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 279 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "nil_string parameter constraints" do
subject { ActionController::Parameters.nil_string }
permits "", as: nil
permits "undefined", as: nil
permits nil
rejects "foo"
end |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/array_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 694 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe StrongerParameters::ArrayConstraint do
subject { ActionController::Parameters.array(ActionController::Parameters.string) }
permits ["a", "b"]
rejects "abc"
rejects 123
rejects [123, 456]
rejects ["abc", 123]
... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/time_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 494 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "time parameter constraints" do
subject { ActionController::Parameters.time }
permits Time.parse("2015-03-31"), as: Time.parse("2015-03-31")
permits "2015-03-31", as: Time.parse("2015-03-31")
permits "2015-03-31T1... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/ulid_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 616 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe StrongerParameters::UlidConstraint do
subject { ActionController::Parameters.ulid }
rejects 123
rejects Date.today
rejects Time.now
rejects nil
rejects "01GTJ6C0NF1MQX0KFZMS1RHTY" # short
rejects "01GTJ6C0NF1... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/time_iso8601_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 571 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "date parameter constraints" do
subject { ActionController::Parameters.time_iso8601 }
permits "2018-04-12T08:53:18+00:00", as: Time.iso8601("2018-04-12T08:53:18+00:00")
permits "2018-04-12T08:53:18Z", as: Time.iso86... |
github | zendesk/stronger_parameters | https://github.com/zendesk/stronger_parameters | test/stronger_parameters/constraints/nil_constraint_test.rb | Ruby | apache-2.0 | 304 | main | 240 | # frozen_string_literal: true
require_relative "../../test_helper"
SingleCov.covered!
describe "nil parameter constraints" do
subject { ActionController::Parameters.nil }
permits nil
rejects "abc"
rejects 1
rejects false
end |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | Gemfile | Ruby | mit | 304 | master | 307 | source 'https://rubygems.org'
# Specify your gem's dependencies in redtape.gemspec
gemspec
group :development do
gem 'minitest'
gem 'virtus'
gem 'rspec'
gem 'rails'
gem 'pry'
platform :ruby do
gem 'sqlite3'
end
platform :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
end
end |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | redtape.gemspec | Ruby | mit | 304 | master | 1,317 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/redtape/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Evan Light"]
gem.email = ["evan.light@tripledogdare.net"]
gem.description = %q{A handy dandy way to avoid using #accepts_nested_attributes_for}
gem.summary ... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | Rakefile | Ruby | mit | 304 | master | 228 | #!/usr/bin/env rake
require 'rubygems'
require 'bundler'
Bundler.require
require 'rails'
require 'rspec'
require 'rspec/core/rake_task'
require "bundler/gem_tasks"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | lib/redtape.rb | Ruby | mit | 304 | master | 1,989 | require "redtape/version"
require "redtape/attribute_whitelist"
require "redtape/model_factory"
require "redtape/populator/abstract"
require "redtape/populator/root"
require "redtape/populator/has_many"
require "redtape/populator/has_one"
require 'active_model'
require 'active_support/core_ext/class/attribute'
requir... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | lib/redtape/model_factory.rb | Ruby | mit | 304 | master | 5,913 | module Redtape
class ModelFactory
attr_reader :top_level_name, :records_to_save, :model, :controller, :attr_whitelist, :attrs
def initialize(args = {})
assert_inputs(args)
@attrs = args[:attrs]
@attr_whitelist = NullAttrWhitelist.new
@controller = args[:controll... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | lib/redtape/attribute_whitelist.rb | Ruby | mit | 304 | master | 1,200 | module Redtape
class AttributeWhitelist
attr_reader :whitelisted_attrs
def initialize(whitelisted_attrs)
@whitelisted_attrs = whitelisted_attrs
end
def top_level_name
whitelisted_attrs.try(:keys).try(:first)
end
def allows?(args = {})
allowed_attrs = whitelisted_attrs_for(... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | lib/redtape/populator/abstract.rb | Ruby | mit | 304 | master | 1,768 | module Redtape
module Populator
class Abstract
attr_reader :association_name, :model, :pending_attributes, :parent, :data_mapper, :attr_whitelist, :whitelist_failures
def initialize(args = {})
@model = args[:model]
@association_name = args[:association_name]
@pe... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | spec/nested_form_spec.rb | Ruby | mit | 304 | master | 3,439 | require 'spec_helper'
class NestedFormController
include NestedFormRedtape
end
describe Redtape::Form do
subject { Redtape::Form.new(controller_stub, :top_level_name => :user) }
let(:create_params) {
HashWithIndifferentAccess.new(
:user => {
:first_name => "Evan",
:last_name => "Light... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | spec/spec_helper.rb | Ruby | mit | 304 | master | 529 | require 'active_support/core_ext/hash/indifferent_access'
require 'redtape'
require 'active_record'
require 'pry'
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => 'development.db')
%w[models redtape].each do |path|
Dir.glob("./spec/fixtures/#{path}/*").each do |r|
require r[0...-3]
... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | spec/automation_spec.rb | Ruby | mit | 304 | master | 4,121 | require 'spec_helper'
class UsersController; end
describe "Using the default ModelFactory" do
let(:create_params) {
HashWithIndifferentAccess.new(
:user => {
:name => "Evan Light",
:social_security_number => "123-456-7890",
:addresses_attributes => {
"0"... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | spec/form_spec.rb | Ruby | mit | 304 | master | 2,079 | require 'spec_helper'
class RegistrationController
include RegistrationRedtape
end
describe Redtape::Form do
subject { Redtape::Form.new(controller_stub, :top_level_name => :user) }
context "given a Form accepting a first and last name that creates a User" do
context "with valid data" do
let (:contro... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | spec/lint_spec.rb | Ruby | mit | 304 | master | 580 | require 'spec_helper'
class RegistrationController
def params
{
:user => {
:name => "Ohai ohai"
}
}
end
end
require 'minitest/unit'
describe "my looks like model class" do
include ActiveModel::Lint::Tests
include MiniTest::Assertions
subject { Redtape::Form.new(RegistrationCont... |
github | ClearFit/redtape | https://github.com/ClearFit/redtape | spec/attribute_whitelist_spec.rb | Ruby | mit | 304 | master | 928 | require 'spec_helper'
describe Redtape::AttributeWhitelist do
subject { Redtape::AttributeWhitelist.new(:user => [:name, {:addresses => [:address1]}]) }
context "#allows?" do
specify { subject.allows?(:association_name => :user, :attr => :name).should be_true }
specify { subject.allows?(:association_name ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | fog-aws.gemspec | Ruby | mit | 304 | master | 1,658 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fog/aws/version'
Gem::Specification.new do |spec|
spec.name = "fog-aws"
spec.version = Fog::AWS::VERSION
spec.authors = ["Josh Lane", "Wesley Beary"]
spec.email ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | Gemfile | Ruby | mit | 304 | master | 352 | source 'https://rubygems.org'
# Specify your gem's dependencies in fog-aws.gemspec
gemspec
gem "fog-core", :github => "fog/fog-core"
gem "fog-json", :github => "fog/fog-json"
group :test, :default do
gem 'ostruct'
gem 'pry-nav'
gem 'mime-types', '~> 3.1'
end
group :test do
gem "simplecov"
gem "codeclimate... |
github | fog/fog-aws | https://github.com/fog/fog-aws | Rakefile | Ruby | mit | 304 | master | 411 | require 'bundler/gem_tasks'
require 'github_changelog_generator/task'
task default: :test
mock = ENV['FOG_MOCK'] || 'true'
task :test do
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
end
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.user = 'fog'
config.project = 'fog-aws'
confi... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/storage_tests.rb | Ruby | mit | 304 | master | 2,025 | # encoding: utf-8
Shindo.tests('AWS Storage | escape', ['aws']) do
tests('Keys can contain a hierarchical prefix which should not be escaped') do
returns(Fog::AWS::Storage.new.send(:escape, 'key/with/prefix')) { 'key/with/prefix' }
end
end
Shindo.tests('AWS Storage | Host header', ['aws']) do
def capture_ho... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/helper.rb | Ruby | mit | 304 | master | 787 | begin
require 'simplecov'
SimpleCov.start
SimpleCov.command_name 'Shindo'
rescue LoadError => e
$stderr.puts "not recording test coverage: #{e.inspect}"
end
require File.expand_path('../../lib/fog/aws', __FILE__)
Bundler.require(:test)
Excon.defaults.merge!(debug_request: true, debug_response: true)
require... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/credentials_tests.rb | Ruby | mit | 304 | master | 13,567 | # frozen_string_literal: true
Shindo.tests('AWS | credentials', ['aws']) do
unchecked_constants = [:CredentialFetcher, :VERSION, :Errors, :Mock, :ServiceMapper, :Federation, :STS, :SignatureV4, :EFS, :Parsers]
test_services = Fog::AWS.constants.delete_if { |service| unchecked_constants.include?(service) }
targ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/signaturev4_tests.rb | Ruby | mit | 304 | master | 6,636 | # encoding: utf-8
Shindo.tests('AWS | signaturev4', ['aws']) do
@now = Fog::Time.utc(2011, 9, 9, 23, 36, 0)
# These testcases are from http://docs.amazonwebservices.com/general/latest/gr/signature-v4-test-suite.html
@signer = Fog::AWS::SignatureV4.new('AKIDEXAMPLE', 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY', '... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/signed_params_tests.rb | Ruby | mit | 304 | master | 558 | # encoding: utf-8
Shindo.tests('AWS | signed_params', ['aws']) do
returns(Fog::AWS.escape("'Stöp!' said Fred_-~./")) { '%27St%C3%B6p%21%27%20said%20Fred_-~.%2F' }
tests('Unicode characters should be escaped') do
unicode = ['00E9'.to_i(16)].pack('U*')
escaped = '%C3%A9'
returns(escaped) { Fog::AWS.esca... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/parsers/elb/describe_load_balancers.rb | Ruby | mit | 304 | master | 2,408 | require 'fog/xml'
require 'fog/aws/parsers/elb/describe_load_balancers'
DESCRIBE_LOAD_BALANCERS_RESULT = <<-EOF
<DescribeLoadBalancersResponse
xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
<DescribeLoadBalancersResult>
<LoadBalancerDescriptions>
<member>
<SecurityGroups/>
... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/parsers/elbv2/describe_tags_tests.rb | Ruby | mit | 304 | master | 1,144 | require 'fog/xml'
require 'fog/aws/parsers/elbv2/describe_tags'
DESCRIBE_TAGS_RESULT = <<-EOF
<DescribeTagsResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeTagsResult>
<TagDescriptions>
<member>
<ResourceArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:loa... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/parsers/elbv2/describe_listeners_tests.rb | Ruby | mit | 304 | master | 3,370 | require 'fog/xml'
require 'fog/aws/parsers/elbv2/describe_listeners'
DESCRIBE_LISTENERS_RESULT = <<-EOF
<DescribeListenersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeListenersResult>
<Listeners>
<member>
<LoadBalancerArn>arn:aws:elasticloadbalancing:us-west-... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/parsers/elbv2/create_load_balancer_tests.rb | Ruby | mit | 304 | master | 1,838 | require 'fog/xml'
require 'fog/aws/parsers/elbv2/create_load_balancer'
CREATE_LOAD_BALANCER_RESULT = <<-EOF
<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<CreateLoadBalancerResult>
<LoadBalancers>
<member>
<LoadBalancerArn>arn:aws:elasticloadbalancin... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/parsers/elbv2/describe_load_balancers_tests.rb | Ruby | mit | 304 | master | 2,094 | require 'fog/xml'
require 'fog/aws/parsers/elbv2/describe_load_balancers'
DESCRIBE_LOAD_BALANCERS_RESULT = <<-EOF
<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeLoadBalancersResult>
<LoadBalancers>
<member>
<LoadBalancerArn>arn:aws:elastic... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/parsers/compute/describe_images_tests.rb | Ruby | mit | 304 | master | 1,339 | require 'fog/xml'
require 'fog/aws/parsers/compute/describe_images'
DESCRIBE_IMAGES_RESULT = <<-EOF
<DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
<requestId>180a8433-ade0-4a6c-b35b-107897579572</requestId>
<imagesSet>
<item>
<imageId>aki-02486376</imageId>
... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/dns/records_tests.rb | Ruby | mit | 304 | master | 1,076 | Shindo.tests("Fog::DNS[:aws] | records", ['aws', 'dns']) do
tests("zones#create").succeeds do
@zone = Fog::DNS[:aws].zones.create(:domain => generate_unique_domain)
end
param_groups = [
# A record
{ :name => @zone.domain, :type => 'A', :ttl => 3600, :value => ['1.2.3.4'] },
# CNAME record
{ ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/dns/record_tests.rb | Ruby | mit | 304 | master | 904 | Shindo.tests("Fog::Dns[:aws] | record", ['aws', 'dns']) do
tests("zones#create").succeeds do
@zone = Fog::DNS[:aws].zones.create(:domain => generate_unique_domain)
end
params = { :name => @zone.domain, :type => 'A', :ttl => 3600, :value => ['1.2.3.4'] }
model_tests(@zone.records, params) do
# Newly ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/elasticache/cluster_tests.rb | Ruby | mit | 304 | master | 1,216 | Shindo.tests('AWS::Elasticache | cache clusters', ['aws', 'elasticache']) do
cluster_params = {
:id => "fog-test-cluster-#{rand(999).to_s}",
:node_type => 'cache.m1.large',
:security_groups => ['default'],
:engine => 'memcached',
:num_nodes => 1
}
pendin... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/elasticache/parameter_groups_tests.rb | Ruby | mit | 304 | master | 390 | Shindo.tests('AWS::Elasticache | parameter groups', ['aws', 'elasticache']) do
group_name = 'fog-test'
description = 'Fog Test'
model_tests(
Fog::AWS[:elasticache].parameter_groups,
{:id => group_name, :description => description}, true
)
collection_tests(
Fog::AWS[:elasticache].parameter_groups... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/elasticache/security_groups_tests.rb | Ruby | mit | 304 | master | 1,384 | Shindo.tests('AWS::Elasticache | security groups', ['aws', 'elasticache']) do
group_name = 'fog-test'
description = 'Fog Test'
pending if Fog.mocking?
model_tests(
Fog::AWS[:elasticache].security_groups,
{:id => group_name, :description => description}, false
) do
# An EC2 group to authorize
ec... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/elasticache/subnet_groups_tests.rb | Ruby | mit | 304 | master | 1,397 | Shindo.tests('AWS::Elasticache | subnet group', ['aws', 'elasticache']) do
# random_differentiator
# Useful when rapidly re-running tests, so we don't have to wait
# several minutes for deleted VPCs/subnets to disappear
suffix = rand(65536).to_s(16)
@subnet_group_name = "fog-test-#{suffix}"
vpc_range = ran... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/efs/mount_targets_tests.rb | Ruby | mit | 304 | master | 1,045 | Shindo.tests("AWS::EFS | mount targets", ["aws", "efs"]) do
@file_system = Fog::AWS[:efs].file_systems.create(:creation_token => "fogtoken#{rand(999).to_s}")
@file_system.wait_for { ready? }
if Fog.mocking?
vpc = Fog::Compute[:aws].vpcs.create(:cidr_block => "10.0.0.0/16")
subnet = Fog::Compute[:aws].sub... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/efs/mount_target_tests.rb | Ruby | mit | 304 | master | 1,674 | Shindo.tests("AWS::EFS | mount target", ["aws", "efs"]) do
@file_system = Fog::AWS[:efs].file_systems.create(:creation_token => "fogtoken#{rand(999).to_s}")
@file_system.wait_for { ready? }
if Fog.mocking?
vpc = Fog::Compute[:aws].vpcs.create(:cidr_block => "10.0.0.0/16")
subnet = Fog::Compute[:aws].subn... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/efs/file_system_tests.rb | Ruby | mit | 304 | master | 367 | Shindo.tests("AWS::EFS | file system", ["aws", "efs"]) do
file_system_params = {
:creation_token => "fogtoken#{rand(999).to_s}"
}
model_tests(Fog::AWS[:efs].file_systems, file_system_params, true)
file_system_params = {
:creation_token => "fogtoken#{rand(999).to_s}"
}
collection_tests(Fog::AWS[:ef... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/glacier/model_tests.rb | Ruby | mit | 304 | master | 1,511 | Shindo.tests('AWS::Glacier | models', ['aws', 'glacier']) do
pending if Fog.mocking?
tests('success') do
tests('vaults') do
tests('getting a missing vault') do
returns(nil) { Fog::AWS[:glacier].vaults.get('no-such-vault') }
end
vault = nil
tests('creating a vault') do
va... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cdn/streaming_distributions_tests.rb | Ruby | mit | 304 | master | 611 | Shindo.tests("Fog::CDN[:aws] | streaming_distributions", ['aws', 'cdn']) do
params = { :s3_origin => { 'DNSName' => 'fog_test_cdn.s3.amazonaws.com'}, :enabled => true}
collection_tests(Fog::CDN[:aws].streaming_distributions, params, true) do
# distribution needs to be ready before being disabled
tests("#rea... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cdn/invalidations_tests.rb | Ruby | mit | 304 | master | 555 | Shindo.tests("Fog::CDN[:aws] | invalidations", ['aws', 'cdn']) do
tests("distributions#create").succeeds do
@distribution = Fog::CDN[:aws].distributions.create(:s3_origin => {'DNSName' => 'fog_test.s3.amazonaws.com'}, :enabled => true)
end
collection_tests(@distribution.invalidations, { :paths => [ '/index.h... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cdn/distributions_tests.rb | Ruby | mit | 304 | master | 591 | Shindo.tests("Fog::CDN[:aws] | distributions", ['aws', 'cdn']) do
params = { :s3_origin => { 'DNSName' => 'fog_test_cdn.s3.amazonaws.com'}, :enabled => true}
collection_tests(Fog::CDN[:aws].distributions, params, true) do
# distribution needs to be ready before being disabled
tests("#ready? - may take 15 mi... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cdn/streaming_distribution_tests.rb | Ruby | mit | 304 | master | 606 | Shindo.tests("Fog::CDN[:aws] | streaming_distribution", ['aws', 'cdn']) do
params = { :s3_origin => { 'DNSName' => 'fog_test_cdn.s3.amazonaws.com'}, :enabled => true }
model_tests(Fog::CDN[:aws].streaming_distributions, params, true) do
# distribution needs to be ready before being disabled
tests("#ready? -... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cdn/distribution_tests.rb | Ruby | mit | 304 | master | 586 | Shindo.tests("Fog::CDN[:aws] | distribution", ['aws', 'cdn']) do
params = { :s3_origin => { 'DNSName' => 'fog_test_cdn.s3.amazonaws.com'}, :enabled => true }
model_tests(Fog::CDN[:aws].distributions, params, true) do
# distribution needs to be ready before being disabled
tests("#ready? - may take 15 minutes... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cdn/invalidation_tests.rb | Ruby | mit | 304 | master | 925 | Shindo.tests("Fog::CDN[:aws] | invalidation", ['aws', 'cdn']) do
tests("distributions#create").succeeds do
@distribution = Fog::CDN[:aws].distributions.create(:s3_origin => {'DNSName' => 'fog_test.s3.amazonaws.com'}, :enabled => true)
end
params = { :paths => [ '/index.html', '/path/to/index.html' ] }
mo... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/data_pipeline/pipelines_tests.rb | Ruby | mit | 304 | master | 302 | Shindo.tests("AWS::DataPipeline | pipelines", ['aws', 'data_pipeline']) do
pending if Fog.mocking?
unique_id = uniq_id
collection_tests(Fog::AWS[:data_pipeline].pipelines, { :id => unique_id, :name => "#{unique_id}-name", :unique_id => unique_id }) do
@instance.wait_for { state }
end
end |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/data_pipeline/pipeline_tests.rb | Ruby | mit | 304 | master | 297 | Shindo.tests("AWS::DataPipeline | pipelines", ['aws', 'data_pipeline']) do
pending if Fog.mocking?
unique_id = uniq_id
model_tests(Fog::AWS[:data_pipeline].pipelines, { :id => unique_id, :name => "#{unique_id}-name", :unique_id => unique_id }) do
@instance.wait_for { state }
end
end |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/elb/model_tests.rb | Ruby | mit | 304 | master | 14,330 | Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do
Fog::AWS::Compute::Mock.reset if Fog.mocking?
@availability_zones = Fog::Compute[:aws].describe_availability_zones('state' => 'available').body['availabilityZoneInfo'].map{ |az| az['zoneName'] }
@key_name = 'fog-test-model'
@vpc = Fog::Compute[:aws].vpcs.crea... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/elb/tagging_tests.rb | Ruby | mit | 304 | master | 545 | Shindo.tests("AWS::ELB | tagging", ['aws', 'elb']) do
@elb5 = Fog::AWS[:elb].load_balancers.create(:id => "fog-test-elb-tagging")
tags1 = {'key1' => 'val1'}
tags2 = {'key2' => 'val2'}
tests "add and remove tags from an ELB" do
returns({}) { @elb5.tags }
returns(tags1) { @... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/sns/topic_tests.rb | Ruby | mit | 304 | master | 431 | Shindo.tests("AWS::SNS | topic", ['aws', 'sns']) do
params = {:id => 'fog'}
model_tests(Fog::AWS[:sns].topics, params) do
@instance.wait_for { ready? }
tests("#display_name").returns('fog') { @instance.display_name }
tests("#update_topic_attribute") do
@instance.update_topic_attribute("DisplayN... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/iam/access_keys_tests.rb | Ruby | mit | 304 | master | 1,361 | Shindo.tests("Fog::Compute[:iam] | access_keys", ['aws','iam']) do
iam = Fog::AWS[:iam]
@username = 'fake_user'
@user = iam.users.create(:id => @username)
tests('#all', 'there are no access keys for a new user').succeeds do
@user.access_keys.empty?
end
tests('#create','an access key').succeeds do
... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/iam/policies_tests.rb | Ruby | mit | 304 | master | 1,558 | Shindo.tests("Fog::Compute[:iam] | policies", ['aws','iam']) do
iam = Fog::AWS[:iam]
@username = 'fake_user'
@user = iam.users.create(:id => @username)
@policy_document = {"Statement"=>[{"Action"=>["sqs:*"], "Effect"=>"Allow", "Resource"=>"*"}]}
@policy_name = 'fake-sqs-policy'
tests('#all', 'there is no... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/iam/groups_tests.rb | Ruby | mit | 304 | master | 1,371 | Shindo.tests("Fog::Compute[:iam] | groups", ['aws','iam']) do
service = Fog::AWS[:iam]
group_name = uniq_id('fog-test-group')
policy_name = uniq_id('fog-test-policy')
group = nil
document = {"Statement" => [{"Effect" => "Allow", "Action" => "*", "Resource" => "*"}]}
tests('#create').succeeds... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/iam/managed_policies_tests.rb | Ruby | mit | 304 | master | 1,974 | Shindo.tests("Fog::Compute[:iam] | managed_policies", ['aws','iam']) do
iam = Fog::AWS[:iam]
tests('#all').succeeds do
iam.managed_policies.size == 100
end
tests('#each').succeeds do
policies = []
iam.managed_policies.each { |policy| policies << policy }
policies.size > 100
end
policy ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/iam/roles_tests.rb | Ruby | mit | 304 | master | 1,953 | Shindo.tests("Fog::Compute[:iam] | roles", ['aws','iam']) do
@iam = Fog::AWS[:iam]
@role_one_name = 'fake_role_one'
@role_two_name = 'fake_role_two'
@role_three_name = 'fake_role_three'
@role_three_path = '/path/to/fake_role_three/'
@role_four_name = 'fake_role_four'
tests('#create').succeeds do
@... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/iam/users_tests.rb | Ruby | mit | 304 | master | 3,006 | Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
iam = Fog::AWS[:iam]
user_one_name = 'fake_user_one'
user_two_name = 'fake_user_two'
user_three_name = 'fake_user_three'
user_three_path = '/path/to/fake_user_three/'
user_four_name = 'fake_user_four'
def all_users
Fog::AWS[:iam].use... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/iam/instance_profile_tests.rb | Ruby | mit | 304 | master | 611 | Shindo.tests("Fog::AWS[:iam] | instance_profiles", ['aws', 'iam']) do
model_tests(Fog::AWS[:iam].instance_profiles, {:name => uniq_id('fog-instance-profile')}) do
@role = Fog::AWS[:iam].roles.create(:rolename => uniq_id('fog-role'))
tests("#add_role('#{@role.rolename}')") do
returns(true) { @instance.a... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/support/trusted_advisor_tests.rb | Ruby | mit | 304 | master | 847 | Shindo.tests("AWS::Support | trusted_advisor_checks", ["aws", "support"]) do
tests("collection#all").succeeds do
Fog::AWS[:support].trusted_advisor_checks.all
end
@identity = Fog::AWS[:support].trusted_advisor_checks.all.first.identity
tests("collection#get(#{@identity})").returns(@identity) do
Fog::A... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/dhcp_options_tests.rb | Ruby | mit | 304 | master | 228 | Shindo.tests("Fog::Compute[:aws] | dhcp_options", ['aws']) do
collection_tests(Fog::Compute[:aws].dhcp_options, {'dhcp_configuration_set' => {'domain-name' => 'example.com', 'domain-name-servers' => '10.10.10.10'}}, true)
end |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/network_acls_tests.rb | Ruby | mit | 304 | master | 587 | Shindo.tests("Fog::Compute[:aws] | network_acls", ['aws']) do
@vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
collection_tests(Fog::Compute[:aws].network_acls, { :vpc_id => @vpc.id }, true)
tests('tags') do
test_tags = {'foo' => 'bar'}
@acl = Fog::Compute[:aws].network_acls.create(... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/subnet_tests.rb | Ruby | mit | 304 | master | 557 | Shindo.tests("Fog::Compute[:aws] | subnet", ['aws']) do
@vpc=Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
model_tests(Fog::Compute[:aws].subnets, {:vpc_id => @vpc.id, :cidr_block => '10.0.10.0/28', :availability_zone => 'us-east-1b'}, true) do
@ni = Fog::Compute[:aws].network_interfaces.create... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/key_pair_tests.rb | Ruby | mit | 304 | master | 575 | Shindo.tests("Fog::Compute[:aws] | key_pair", ['aws']) do
model_tests(Fog::Compute[:aws].key_pairs, {:name => 'fogkeyname'}, true)
after do
@keypair.destroy
end
tests("new keypair") do
@keypair = Fog::Compute[:aws].key_pairs.create(:name => 'testkey')
test ("writable?") do
@keypair.writabl... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/server_tests.rb | Ruby | mit | 304 | master | 2,276 | Shindo.tests("Fog::Compute[:aws] | monitor", ['aws']) do
@instance = Fog::Compute[:aws].servers.new
[:addresses, :flavor, :key_pair, :key_pair=, :volumes, :associate_public_ip].each do |association|
responds_to(association)
end
tests('new instance') do
test('#monitor = true') do
@instance.moni... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/dhcp_option_tests.rb | Ruby | mit | 304 | master | 223 | Shindo.tests("Fog::Compute[:aws] | dhcp_options", ['aws']) do
model_tests(Fog::Compute[:aws].dhcp_options, {'dhcp_configuration_set' => {'domain-name' => 'example.com', 'domain-name-servers' => '10.10.10.10'}}, true)
end |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/vpcs_tests.rb | Ruby | mit | 304 | master | 505 | Shindo.tests("Fog::Compute[:aws] | vpcs", ['aws']) do
collection_tests(Fog::Compute[:aws].vpcs, {:cidr_block => '10.0.10.0/28'}, true)
tests('tags') do
test_tags = {'foo' => 'bar'}
@vpc = Fog::Compute[:aws].vpcs.create(:cidr_block => '1.2.3.4/24', :tags => test_tags)
tests('@vpc.tags').returns(test_t... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/vpc_tests.rb | Ruby | mit | 304 | master | 918 | Shindo.tests("Fog::Compute[:aws] | vpc", ['aws']) do
model_tests(Fog::Compute[:aws].vpcs, {:cidr_block => '10.0.10.0/28'}, true) do
tests("#enable_classic_link") do
returns(false) { @instance.classic_link_enabled? }
returns(true) { @instance.enable_classic_link }
returns(true) { @instance.cla... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/volume_tests.rb | Ruby | mit | 304 | master | 1,564 | Shindo.tests('Fog::Compute[:aws] | volume', ['aws']) do
@server = Fog::Compute[:aws].servers.create
@server.wait_for { ready? }
model_tests(
Fog::Compute[:aws].volumes,
{
availability_zone: @server.availability_zone,
size: 1,
tags: { 'key' => 'value' },
type: 'gp2',
server: ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/snapshots_tests.rb | Ruby | mit | 304 | master | 298 | Shindo.tests("Fog::Compute[:aws] | snapshots", ['aws']) do
@volume = Fog::Compute[:aws].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
@volume.wait_for { ready? }
collection_tests(Fog::Compute[:aws].snapshots, {:volume_id => @volume.identity}, true)
@volume.destroy
end |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/network_interfaces_test.rb | Ruby | mit | 304 | master | 500 | Shindo.tests("Fog::Compute[:aws] | network_interfaces", ['aws']) do
@vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
@subnet = Fog::Compute[:aws].subnets.create('vpc_id' => @vpc.id, 'cidr_block' => '10.0.10.16/28')
@subnet_id = @subnet.subnet_id
collection_tests(Fog::Compute[:aws]... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/network_acl_tests.rb | Ruby | mit | 304 | master | 3,554 | Shindo.tests("Fog::Compute[:aws] | network_acl", ['aws']) do
@vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
@subnet = Fog::Compute[:aws].subnets.create('vpc_id' => @vpc.id, 'cidr_block' => '10.0.10.16/28')
model_tests(Fog::Compute[:aws].network_acls, { :vpc_id => @vpc.id }, true)
tes... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/snapshot_tests.rb | Ruby | mit | 304 | master | 292 | Shindo.tests("Fog::Compute[:aws] | snapshot", ['aws']) do
@volume = Fog::Compute[:aws].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
@volume.wait_for { ready? }
model_tests(Fog::Compute[:aws].snapshots, {:volume_id => @volume.identity}, true)
@volume.destroy
end |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/address_tests.rb | Ruby | mit | 304 | master | 1,005 | Shindo.tests("Fog::Compute[:aws] | address", ['aws']) do
model_tests(Fog::Compute[:aws].addresses, {}, true) do
@server = Fog::Compute[:aws].servers.create
@server.wait_for { ready? }
tests('#server=').succeeds do
@instance.server = @server
end
tests('#server') do
test(' == @server... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/subnets_tests.rb | Ruby | mit | 304 | master | 289 | Shindo.tests("Fog::Compute[:aws] | subnets", ['aws']) do
@vpc=Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/28')
collection_tests(Fog::Compute[:aws].subnets, { :vpc_id => @vpc.id, :cidr_block => '10.0.10.0/28', :availability_zone => 'us-east-1c'}, true)
@vpc.destroy
end |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/compute/security_group_tests.rb | Ruby | mit | 304 | master | 3,438 | Shindo.tests("Fog::Compute[:aws] | security_group", ['aws']) do
model_tests(Fog::Compute[:aws].security_groups, {:description => 'foggroupdescription', :name => 'foggroupname'}, true)
tests("authorize and revoke helpers") do
@group = Fog::Compute[:aws].security_groups.create(:name => "foggroup", :description ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cloud_watch/alarm_history_tests.rb | Ruby | mit | 304 | master | 530 | Shindo.tests("AWS::CloudWatch | alarm_histories", ['aws', 'cloudwatch']) do
pending if Fog.mocking?
tests('success') do
tests("#all").succeeds do
Fog::AWS[:cloud_watch].alarm_histories.all
end
new_attributes = {
:alarm_name => 'tmp-alarm',
:end_date => '',
:history_item_type => ... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cloud_watch/alarm_data_tests.rb | Ruby | mit | 304 | master | 1,117 | Shindo.tests("AWS::CloudWatch | alarm_data", ['aws', 'cloudwatch']) do
pending if Fog.mocking?
tests('success') do
tests("#all").succeeds do
Fog::AWS[:cloud_watch].alarm_data.all
end
alarm_name_prefix = {'AlarmNamePrefix'=>'tmp'}
tests("#all_by_prefix").succeeds do
Fog::AWS[:cloud_wat... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cloud_watch/metric_statistics_tests.rb | Ruby | mit | 304 | master | 1,603 | Shindo.tests("AWS::CloudWatch | metric_statistics", ['aws', 'cloudwatch']) do
tests('success') do
pending if Fog.mocking?
instanceId = 'i-420c352f'
metricName = 'DiskReadBytes'
namespace = 'AWS/EC2'
startTime = (Time.now-600).iso8601
endTime = Time.now.iso8601
period = 60
statisticTy... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/cloud_watch/metrics_tests.rb | Ruby | mit | 304 | master | 960 | Shindo.tests("AWS::CloudWatch | metrics", ['aws', 'cloudwatch']) do
tests('success') do
pending # FIXME: the hardcoded instance id won't be available
tests("#all").succeeds do
Fog::AWS[:cloud_watch].metrics.all
end
instanceId = 'i-fd713391'
metricName = 'CPUUtilization'
namespace = 'AWS... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/auto_scaling/groups_test.rb | Ruby | mit | 304 | master | 697 | Shindo.tests('AWS::AutoScaling | group', ['aws', 'auto_scaling_m']) do
params = {
:id => uniq_id,
:auto_scaling_group_name => "name",
:availability_zones => [],
:launch_configuration_name => "lc"
}
lc_params = {
:id => params[:launch_configuration_name],
:image_id => "image-id",
:ins... |
github | fog/fog-aws | https://github.com/fog/fog-aws | tests/models/auto_scaling/activities_tests.rb | Ruby | mit | 304 | master | 200 | Shindo.tests('AWS::AutoScaling | activities', ['aws', 'auto_scaling_m']) do
pending # FIXME: activity#save is not implemented
collection_tests(Fog::AWS[:auto_scaling].activities, {}, false)
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.