{"id":19687181,"url":"https://github.com/trinitronx/strainer-berkshelf-chefspec-recursive-bug","last_synced_at":"2025-02-27T07:51:18.099Z","repository":{"id":9490029,"uuid":"11380110","full_name":"trinitronx/strainer-berkshelf-chefspec-recursive-bug","owner":"trinitronx","description":"A demo cookbook for reproducing a bug in Strainer.  Also intends to be a development spike for using chefspec, Strainer, and Berkshelf","archived":false,"fork":false,"pushed_at":"2013-07-15T20:53:13.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-10T07:47:10.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinitronx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-12T23:32:27.000Z","updated_at":"2020-02-02T21:57:45.000Z","dependencies_parsed_at":"2022-08-29T02:40:52.591Z","dependency_job_id":null,"html_url":"https://github.com/trinitronx/strainer-berkshelf-chefspec-recursive-bug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fstrainer-berkshelf-chefspec-recursive-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fstrainer-berkshelf-chefspec-recursive-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fstrainer-berkshelf-chefspec-recursive-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fstrainer-berkshelf-chefspec-recursive-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinitronx","download_url":"https://codeload.github.com/trinitronx/strainer-berkshelf-chefspec-recursive-bug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240993952,"owners_count":19890419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T18:33:20.112Z","updated_at":"2025-02-27T07:51:18.075Z","avatar_url":"https://github.com/trinitronx.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"strainer-berkshelf-chefspec-recursive-bug Cookbook\n==================================================\nThis cookbook is a demo cookbook for reproducing a bug in [Strainer](https://github.com/customink/strainer).  It includes a semi-workaround for the recursive creation of `vendor/cookbooks` directories.\n\nTo reproduce the bug:\n\n 1. Run `cd cookbooks/strainer-berkshelf-chefspec-recursive-bug \u0026\u0026 bundle exec rspec`\n 2. Notice 1 test passes\n 3. Run `cd cookbooks/strainer-berkshelf-chefspec-recursive-bug; strainer test`\n 4. Notice output `2 examples, 0 failures`, duplicated RSpec tests, and recursively copied path in Strainer sandbox: \n `#{Strainer.sandbox_path.to_s}/strainer-berkshelf-chefspec-recursive-bug/vendor/cookbooks/strainer-berkshelf-chefspec-recursive-bug/spec/`\n 5. Repeat Step 1.\n 6. Repeat Step 3.\n 7. Notice yet another recursive directory created in `vendor/cookbooks`, and tests fail with **LoadError**:\n `#{Strainer.sandbox_path.to_s}/strainer-berkshelf-chefspec-recursive-bug/vendor/cookbooks/strainer-berkshelf-chefspec-recursive-bug/vendor/cookbooks/strainer-berkshelf-chefspec-recursive-bug/spec/default_spec.rb`\n\nPlease see `spec/spec_helper.rb` for some debug info \u0026 help to see what is going on.\n\nIt also intends to be a [development spike](http://www.extremeprogramming.org/rules/spike.html) and demonstrates a couple useful things for testing Chef cookbooks:\n\n - A way to detect that Strainer is in use from within rspec.\n - The use of [chefspec](https://github.com/acrmp/chefspec), a gem that enables you to write rspec tests for your chef recipes without having to actually run them on a node.\n - Allowing the testing a cookbook with dependencies via standalone rspec: `bundle exec rspec` (by using [Berkshelf](http://berkshelf.com/))\n - The use of encrypted data bags within chefspec tests.\n - Some useful chefspec helpers (See: `spec/support/chefspec_helpers.rb`)\n - How to allow the use of encrypted data bags within chefspec tests + a chefspec helper to stub out data bags.\n - Cookbook repo \u0026 Chef repo structure required to test multiple ways using Strainer.\n\nYou can [learn about chefspec here](https://www.relishapp.com/acrmp/chefspec/docs). You can [learn about RSpec here](https://www.relishapp.com/rspec).\nYou can [learn about Strainer here](https://github.com/customink/strainer). And of course chef can be found at [Opscode](http://wiki.opscode.com/display/chef/Home)\n\nTo install: clone this repo, install Bundler (`gem install bundler`), and install the chefspec gems via bundler (`bundle install`).\n\nYou can run the tests any of 3 ways:\n\n 1. Within the fake chef repo:\n   - `strainer test strainer-berkshelf-chefspec-recursive-bug` (optionally add: `-d` for strainer's debug output)\n 3. Within the cookbook dir itself:\n   - `cd cookbooks/strainer-berkshelf-chefspec-recursive-bug; bundle exec rspec`\n   - `cd cookbooks/strainer-berkshelf-chefspec-recursive-bug; strainer test`\n\nRequirements\n------------\n\n#### packages\n- `chef-solo-search` - strainer-berkshelf-chefspec-recursive-bug needs chef-solo-search to test recipes that use search.\n\nAttributes\n----------\nN/A\n\nUsage\n-----\n#### strainer-berkshelf-chefspec-recursive-bug::default\n\nJust include `strainer-berkshelf-chefspec-recursive-bug` in your node's `run_list`:\n\n```json\n{\n  \"name\":\"my_node\",\n  \"run_list\": [\n    \"recipe[strainer-berkshelf-chefspec-recursive-bug]\"\n  ]\n}\n```\n\nKnown Bugs\n----------\n\nCurrently cannot run RSpec from top-level chef repo due to *Chef::Exceptions::CookbookNotFound*:\n\n  - [ ] Fix `bundle exec rspec cookbooks/strainer-berkshelf-chefspec-recursive-bug/`\n\n\nContributing\n------------\n\n1. Fork the repository on Github\n2. Create a named feature branch (like `add_component_x`)\n3. Write you change\n4. Write tests for your change (if applicable)\n5. Run the tests, ensuring they all pass\n6. Submit a Pull Request using Github\n\nLicense and Authors\n-------------------\nAuthors: James Cuzella\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinitronx%2Fstrainer-berkshelf-chefspec-recursive-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinitronx%2Fstrainer-berkshelf-chefspec-recursive-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinitronx%2Fstrainer-berkshelf-chefspec-recursive-bug/lists"}