diff options
| author | mo khan <mo@mokhan.ca> | 2015-09-12 21:49:08 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-09-12 21:49:08 -0600 |
| commit | 7df13c50c9b47e73671d7429e3932320d5edb29b (patch) | |
| tree | 65a2ba0b205561e6f9c570e6a99f7e13434a2d0b | |
| parent | 73cda9159dfe9d154a5789bd2e5822f4065b0e7c (diff) | |
add specs for default recipe.
| -rw-r--r-- | .rspec | 2 | ||||
| -rw-r--r-- | Gemfile | 7 | ||||
| -rw-r--r-- | Gemfile.lock | 226 | ||||
| -rw-r--r-- | recipes/default.rb | 11 | ||||
| -rw-r--r-- | recipes/nginx.rb | 0 | ||||
| -rw-r--r-- | recipes/puma.rb | 0 | ||||
| -rw-r--r-- | recipes/ruby.rb | 0 | ||||
| -rw-r--r-- | spec/recipes/default_spec.rb | 19 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 97 |
9 files changed, 354 insertions, 8 deletions
@@ -0,0 +1,2 @@ +--color +--require spec_helper @@ -0,0 +1,7 @@ +# A sample Gemfile +source "https://rubygems.org" + +gem 'berkshelf' +gem 'chefspec' +gem 'test-kitchen' +gem 'kitchen-vagrant' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..05332e9 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,226 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.3.8) + berkshelf (3.3.0) + addressable (~> 2.3.4) + berkshelf-api-client (~> 1.2) + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-shell_out (~> 0.1) + celluloid (~> 0.16.0) + celluloid-io (~> 0.16.1) + cleanroom (~> 1.0) + faraday (~> 0.9.0) + httpclient (~> 2.6.0) + minitar (~> 0.5.4) + octokit (~> 3.0) + retryable (~> 2.0) + ridley (~> 4.0) + solve (~> 1.1) + thor (~> 0.19) + berkshelf-api-client (1.3.0) + faraday (~> 0.9.0) + httpclient (~> 2.6.0) + buff-config (1.0.1) + buff-extensions (~> 1.0) + varia_model (~> 0.4) + buff-extensions (1.0.0) + buff-ignore (1.1.1) + buff-ruby_engine (0.1.0) + buff-shell_out (0.2.0) + buff-ruby_engine (~> 0.1.0) + builder (3.2.2) + celluloid (0.16.0) + timers (~> 4.0.0) + celluloid-io (0.16.2) + celluloid (>= 0.16.0) + nio4r (>= 1.1.0) + chef (12.3.0) + chef-zero (~> 4.1) + diff-lcs (~> 1.2, >= 1.2.4) + erubis (~> 2.7) + ffi-yajl (>= 1.2, < 3.0) + highline (~> 1.6, >= 1.6.9) + mixlib-authentication (~> 1.3) + mixlib-cli (~> 1.4) + mixlib-config (~> 2.0) + mixlib-log (~> 1.3) + mixlib-shellout (>= 2.0.0.rc.0, < 3.0) + net-ssh (~> 2.6) + net-ssh-multi (~> 1.1) + ohai (~> 8.0) + plist (~> 3.1.0) + pry (~> 0.9) + rspec-core (~> 3.2) + rspec-expectations (~> 3.2) + rspec-mocks (~> 3.2) + rspec_junit_formatter (~> 0.2.0) + serverspec (~> 2.7) + specinfra (~> 2.10) + chef-config (12.5.0.alpha.1) + mixlib-config (~> 2.0) + mixlib-shellout (~> 2.0) + chef-zero (4.3.0) + ffi-yajl (~> 2.2) + hashie (~> 2.0) + mixlib-log (~> 1.3) + rack + uuidtools (~> 2.1) + chefspec (4.3.0) + chef (>= 11.14) + fauxhai (~> 2.0) + rspec (~> 3.0) + cleanroom (1.0.0) + coderay (1.1.0) + dep-selector-libgecode (1.0.2) + dep_selector (1.0.3) + dep-selector-libgecode (~> 1.0) + ffi (~> 1.9) + diff-lcs (1.2.5) + erubis (2.7.0) + faraday (0.9.1) + multipart-post (>= 1.2, < 3) + fauxhai (2.3.0) + net-ssh + ohai + ffi (1.9.10) + ffi-yajl (2.2.2) + libyajl2 (~> 1.2) + hashie (2.1.2) + highline (1.7.3) + hitimes (1.2.2) + httpclient (2.6.0.1) + ipaddress (0.8.0) + json (1.8.3) + kitchen-vagrant (0.18.0) + test-kitchen (~> 1.4) + libyajl2 (1.2.0) + method_source (0.8.2) + mime-types (2.6.1) + minitar (0.5.4) + mixlib-authentication (1.3.0) + mixlib-log + mixlib-cli (1.5.0) + mixlib-config (2.2.1) + mixlib-log (1.6.0) + mixlib-shellout (2.2.1) + multi_json (1.11.2) + multipart-post (2.0.0) + net-http-persistent (2.9.4) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (2.9.2) + net-ssh-gateway (1.2.0) + net-ssh (>= 2.6.5) + net-ssh-multi (1.2.1) + net-ssh (>= 2.6.5) + net-ssh-gateway (>= 1.2.0) + net-telnet (0.1.1) + nio4r (1.1.1) + octokit (3.8.0) + sawyer (~> 0.6.0, >= 0.5.3) + ohai (8.6.0) + chef-config (>= 12.5.0.alpha.1, < 13) + ffi (~> 1.9) + ffi-yajl (~> 2.2) + ipaddress + mime-types (~> 2.0) + mixlib-cli + mixlib-config (~> 2.0) + mixlib-log + mixlib-shellout (~> 2.0) + rake (~> 10.1) + systemu (~> 2.6.4) + wmi-lite (~> 1.0) + plist (3.1.0) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + rack (1.6.4) + rake (10.4.2) + retryable (2.0.2) + ridley (4.2.0) + addressable + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-ignore (~> 1.1) + buff-shell_out (~> 0.1) + celluloid (~> 0.16.0) + celluloid-io (~> 0.16.1) + erubis + faraday (~> 0.9.0) + hashie (>= 2.0.2, < 3.0.0) + json (>= 1.7.7) + mixlib-authentication (>= 1.3.0) + net-http-persistent (>= 2.8) + retryable (~> 2.0) + semverse (~> 1.1) + varia_model (~> 0.4) + rspec (3.3.0) + rspec-core (~> 3.3.0) + rspec-expectations (~> 3.3.0) + rspec-mocks (~> 3.3.0) + rspec-core (3.3.2) + rspec-support (~> 3.3.0) + rspec-expectations (3.3.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.3.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.3.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.3.0) + rspec-support (3.3.0) + rspec_junit_formatter (0.2.3) + builder (< 4) + rspec-core (>= 2, < 4, != 2.12.0) + safe_yaml (1.0.4) + sawyer (0.6.0) + addressable (~> 2.3.5) + faraday (~> 0.8, < 0.10) + semverse (1.2.1) + serverspec (2.23.1) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.43) + sfl (2.2) + slop (3.6.0) + solve (1.2.1) + dep_selector (~> 1.0) + semverse (~> 1.1) + specinfra (2.43.4) + net-scp + net-ssh (~> 2.7) + net-telnet + sfl + systemu (2.6.5) + test-kitchen (1.4.2) + mixlib-shellout (>= 1.2, < 3.0) + net-scp (~> 1.1) + net-ssh (~> 2.7, < 2.10) + safe_yaml (~> 1.0) + thor (~> 0.18) + thor (0.19.1) + timers (4.0.4) + hitimes + uuidtools (2.1.5) + varia_model (0.4.0) + buff-extensions (~> 1.0) + hashie (>= 2.0.2, < 3.0.0) + wmi-lite (1.0.0) + +PLATFORMS + ruby + +DEPENDENCIES + berkshelf + chefspec + kitchen-vagrant + test-kitchen + +BUNDLED WITH + 1.10.6 diff --git a/recipes/default.rb b/recipes/default.rb index 430a1bb..17721b5 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,8 +1,3 @@ -# -# Cookbook Name:: chef-talk -# Recipe:: default -# -# Copyright 2015, YOUR_COMPANY_NAME -# -# All rights reserved - Do Not Redistribute -# +include_recipe "chef-talk::ruby" +include_recipe "chef-talk::nginx" +include_recipe "chef-talk::puma" diff --git a/recipes/nginx.rb b/recipes/nginx.rb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/recipes/nginx.rb diff --git a/recipes/puma.rb b/recipes/puma.rb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/recipes/puma.rb diff --git a/recipes/ruby.rb b/recipes/ruby.rb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/recipes/ruby.rb diff --git a/spec/recipes/default_spec.rb b/spec/recipes/default_spec.rb new file mode 100644 index 0000000..3324d95 --- /dev/null +++ b/spec/recipes/default_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe "chef-talk::default" do + subject do + ChefSpec::SoloRunner.new.converge(described_recipe) + end + + it 'installs ruby' do + expect(subject).to include_recipe('chef-talk::ruby') + end + + it 'installs nginx' do + expect(subject).to include_recipe('chef-talk::nginx') + end + + it 'installs puma' do + expect(subject).to include_recipe('chef-talk::puma') + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..f9b1282 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,97 @@ +# This file was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +require 'chefspec' +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end |
