https://github.com/maoueh/chefspec-stub-problem
Demonstrates a ChefSpec stub problem I have
https://github.com/maoueh/chefspec-stub-problem
Last synced: 9 months ago
JSON representation
Demonstrates a ChefSpec stub problem I have
- Host: GitHub
- URL: https://github.com/maoueh/chefspec-stub-problem
- Owner: maoueh
- Created: 2015-02-11T20:22:33.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-11T20:24:46.000Z (almost 11 years ago)
- Last Synced: 2024-10-08T03:32:39.362Z (about 1 year ago)
- Language: Ruby
- Size: 117 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stubbing Problem
Trying to stub a library class method defined in `Chef::Recipe` class
which calls a program not accessible on the machine running the unit
tests.
The problem is that I'm simply unable to make it work correctly.
## Reproduce
bundle install
bundle exec rspec spec/recipes/default_spec.rb
Expected output is a passing test
Actual output is an error message saying command cannot be found
```
$ bundle exec rspec spec/recipes/default_spec.rb
Called in spec before: 1.3
Called in spec example: 1.3
Called in spec runner new: 1.3
...
================================================================================
Recipe Compile Error in /vagrant/stub_problem/recipes/default.rb
================================================================================
...
Failures:
1) stub_problem::default includes default recipe
Failure/Error: end.converge(described_recipe)
Errno::ENOENT:
No such file or directory - impossible_command_to_stub
# ./libraries/stub_problem_library.rb:6:in `query'
# ./recipes/default.rb:2:in `from_file'
# ./spec/recipes/default_spec.rb:9:in `block (2 levels) in '
# ./spec/recipes/default_spec.rb:27:in `block (2 levels) in '
Finished in 0.12096 seconds (files took 1.04 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/recipes/default_spec.rb:24 # stub_problem::default includes default recipe
```