describe "FC123" do
context "the readme has the REQUIREMENTS section" do
readme_file <<-EOF
# cookbook
## Requirements
EOF
it { is_expected.not_to violate_rule }
end
context "the readme does not have a REQUIREMENTS section" do
readme_file <<-EOF
# cookbook
Some description.
EOF
it { is_expected.to violate_rule }
end
end
In the above example, inspired from https://github.com/Foodcritic/foodcritic/blob/master/spec/functional/fc093_spec.rb seem to be reading in the README.md from the main repo not overwriting it for the mocked out cookbook.