Coder Social home page Coder Social logo

chefspec-bootstrap's People

Contributors

ameng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

elthariel

chefspec-bootstrap's Issues

Some actions do not work

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

Fix Travis warnings

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.

Automatically generate search stubs

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.

Add support for not_if and only_if clauses.

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.

Auto-create directory structure for output file

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.

Create proper specs for compile time actions

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

Specs should test attributes by generating .with() clauses

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

Generate specs for given recipe only.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.