Skip to content

Instantly share code, notes, and snippets.

@borntyping
Created February 7, 2014 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borntyping/8864591 to your computer and use it in GitHub Desktop.
Save borntyping/8864591 to your computer and use it in GitHub Desktop.
describe "fauxhai" do
before { Fauxhai.mock(platform: "centos", version: "6.4") }
let(:chef_run) { ChefSpec::Runner.new.converge() }
it "sets the platform correctly" do
expect(chef_run.node["platform"]).to eq("centos")
end
end
$ rspec
fauxhai
sets the platform correctly (FAILED - 1)
Failures:
1) fauxhai sets the platform correctly
Failure/Error: expect(chef_run.node["platform"]).to eq("centos")
expected: "centos"
got: "chefspec"
(compared using ==)
# ./spec/spec_helpers.rb:20:in `block (2 levels) in <top (required)>'
Finished in 0.29133 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/spec_helpers.rb:19 # fauxhai sets the platform correctly
Command rspec --fail-fast exited with code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment