ameng / chefspec-bootstrap Goto Github PK
View Code? Open in Web Editor NEWA tool to get started with ChefSpec
License: Apache License 2.0
A tool to get started with ChefSpec
License: Apache License 2.0
Travis-CI gives a warning message during builds about duplicate gem specifications.
Your Gemfile lists the gem rake (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem rspec (~> 3.0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Not sure how best to handle this. Maybe just leaving those specs out, or putting comments specifying that a not_if
or only_if
block was found.
As it stands these specs are usually created in a failing state.
If a spec_helper.rb
file is found, it should be used to execute the ChefSpec run.
Currently generated specs are not valid to rubocop. Fix by altering the templates
If you specify an output file to a directory that does not exist, a Ruby error is raised.
$ chefspec-bootstrap recipe.rb -o a/b/c/d.txt
/chefspec-bootstrap/lib/chefspec-bootstrap.rb:61:in `initialize': No such file or directory - a/b/c/d.txt (Errno::ENOENT)
from /chefspec-bootstrap/lib/chefspec-bootstrap.rb:61:in `open'
from /chefspec-bootstrap/lib/chefspec-bootstrap.rb:61:in `generate'
from /chefspec-bootstrap/bin/chefspec-bootstrap:35:in `<top (required)>'
from /.rvm/gems/ruby-1.9.3-p429/bin/chefspec-bootstrap:19:in `load'
from /.rvm/gems/ruby-1.9.3-p429/bin/chefspec-bootstrap:19:in `<main>'
from /.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval'
from /.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>'
The directories should be auto-created if they do not exist.
When a search is used in a recipe, it generates this error:
#<ChefSpec::Error::SearchNotStubbed: Executing a real search is disabled. Unregistered search:
search(:my_search, "*:*")
You can stub this search with:
stub_search("my_search", "*:*").and_return(...)
Should catch this exception and create a stub_search
block in the spec.
Currently if a cookbook has 10 recipes, it will generate 10 spec files. It might be nice to allow for creating one spec file with 10 separate describe
blocks.
Actions like :create_if_missing
result in badly formatted specs because they don't fit well into the verb
, noun
, adjective
model.
it "create_if_missings the /opt/graphite/storage/graphite.db cookbook_file" do
expect(chef_run).to create_if_missing_cookbook_file("/opt/graphite/storage/graphite.db")
end
Generated specs do not test any extra attributes. For example:
Recipe:
template "destination" do
source "source"
end
Generated spec currently:
it "creates the destination template" do
expect(chef_run).to create_template("destination")
end
Generated spec should look like:
it "creates the destination template" do
expect(chef_run).to create_template("destination").with({:source => "source"})
end
Or maybe just put comments in the specs indicating that they need to be stubbed.
Currently you can only specify a cookbook directory and generate specs for all cookbooks and recipes.
Use rubocop in the travis build
Currently when a spec is generated, any included recipes have their actions placed into the spec file as well. So a recipe that is only one line might end up generating a large amount of specs:
include_recipe "whatever"
Currently all actions from the whatever
recipe will be included in the generated spec.
A recipe with a compile time action should generate a spec with .at_compile_time
Recipe:
package('compile_time') { action :nothing }.run_action(:install)
Spec:
it 'installs the compile_time package' do
expect(chef_run).to install_package('compile_time').at_compile_time
end
Currently when include_recipe
is used, a spec is not created for that.
Currently during the command line run, all Chef errors are displayed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.