kitchen-ec2 2.2.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,107 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #
3
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
- #
5
- # Copyright:: 2015-2018, Fletcher Nichol
6
- # Copyright:: 2016-2018, Chef Software, Inc.
7
- #
8
- # Licensed under the Apache License, Version 2.0 (the "License");
9
- # you may not use this file except in compliance with the License.
10
- # You may obtain a copy of the License at
11
- #
12
- # http://www.apache.org/licenses/LICENSE-2.0
13
- #
14
- # Unless required by applicable law or agreed to in writing, software
15
- # distributed under the License is distributed on an "AS IS" BASIS,
16
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- # See the License for the specific language governing permissions and
18
- # limitations under the License.
19
-
20
- require "support/fake_image"
21
-
22
- if ENV["CODECLIMATE_REPO_TOKEN"]
23
- require "codeclimate-test-reporter"
24
- CodeClimate::TestReporter.start
25
- elsif ENV["COVERAGE"]
26
- require "simplecov"
27
- SimpleCov.profiles.define "gem" do
28
- command_name "Specs"
29
-
30
- add_filter ".gem/"
31
- add_filter "/spec/"
32
-
33
- add_group "Libraries", "/lib/"
34
- end
35
- SimpleCov.start "gem"
36
- end
37
-
38
- RSpec.configure do |config|
39
- # rspec-expectations config goes here. You can use an alternate
40
- # assertion/expectation library such as wrong or the stdlib/minitest
41
- # assertions if you prefer.
42
- config.expect_with :rspec do |expectations|
43
- # This option will default to `true` in RSpec 4. It makes the `description`
44
- # and `failure_message` of custom matchers include text for helper methods
45
- # defined using `chain`, e.g.:
46
- # be_bigger_than(2).and_smaller_than(4).description
47
- # # => "be bigger than 2 and smaller than 4"
48
- # ...rather than:
49
- # # => "be bigger than 2"
50
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
51
- end
52
-
53
- # rspec-mocks config goes here. You can use an alternate test double
54
- # library (such as bogus or mocha) by changing the `mock_with` option here.
55
- config.mock_with :rspec do |mocks|
56
- # Prevents you from mocking or stubbing a method that does not exist on
57
- # a real object. This is generally recommended, and will default to
58
- # `true` in RSpec 4.
59
- mocks.verify_partial_doubles = true
60
- end
61
-
62
- # These two settings work together to allow you to limit a spec run
63
- # to individual examples or groups you care about by tagging them with
64
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
65
- # get run.
66
- config.filter_run :focus
67
- config.run_all_when_everything_filtered = true
68
-
69
- # Limits the available syntax to the non-monkey patched syntax that is
70
- # recommended. For more details, see:
71
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
72
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
73
- config.disable_monkey_patching!
74
-
75
- # This setting enables warnings. It's recommended, but in some cases may
76
- # be too noisy due to issues in dependencies.
77
- config.warnings = true
78
-
79
- # Many RSpec users commonly either run the entire suite or an individual
80
- # file, and it's useful to allow more verbose output when running an
81
- # individual spec file.
82
- if config.files_to_run.one?
83
- # Use the documentation formatter for detailed output,
84
- # unless a formatter has already been configured
85
- # (e.g. via a command-line flag).
86
- config.default_formatter = "doc"
87
- end
88
-
89
- # Run specs in random order to surface order dependencies. If you find an
90
- # order dependency and want to debug it, you can fix the order by providing
91
- # the seed, which is printed after each run.
92
- # --seed 1234
93
- config.order = :random
94
-
95
- # Seed global randomization in this process using the `--seed` CLI option.
96
- # Setting this allows you to use `--seed` to deterministically reproduce
97
- # test failures related to randomization by passing the same `--seed` value
98
- # as the one that triggered the failure.
99
- Kernel.srand config.seed
100
-
101
- config.expose_dsl_globally = true
102
-
103
- end
104
-
105
- require "aws-sdk"
106
- # https://ruby.awsblog.com/post/Tx15V81MLPR8D73/Client-Response-Stubs
107
- Aws.config[:stub_responses] = true
@@ -1,36 +0,0 @@
1
- class FakeImage
2
- def self.next_ami
3
- @n ||= 0
4
- @n += 1
5
- [sprintf("ami-%08x", @n), Time.now + @n]
6
- end
7
-
8
- def initialize(name: "foo")
9
- @id, @creation_date = FakeImage.next_ami
10
- @name = name
11
- @creation_date = @creation_date.strftime("%F %T")
12
- @architecture = :x86_64
13
- @volume_type = "gp2"
14
- @root_device_type = "ebs"
15
- @virtualization_type = "hvm"
16
- @root_device_name = "root"
17
- @device_name = "root"
18
- end
19
- attr_reader :id
20
- attr_reader :name
21
- attr_reader :creation_date
22
- attr_reader :architecture
23
- attr_reader :volume_type
24
- attr_reader :root_device_type
25
- attr_reader :virtualization_type
26
- attr_reader :root_device_name
27
- attr_reader :device_name
28
-
29
- def block_device_mappings
30
- [self]
31
- end
32
-
33
- def ebs
34
- self
35
- end
36
- end