Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

readme_file method doesn't mock out a file in testing #762

Open
jjasghar opened this issue May 25, 2018 · 0 comments
Open

readme_file method doesn't mock out a file in testing #762

jjasghar opened this issue May 25, 2018 · 0 comments

Comments

@jjasghar
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant