]> git.immae.eu Git - github/fretlink/pronto-hlint.git/blobdiff - spec/spec_helper.rb
Merge pull request #10 from doits/refactor_config_handling
[github/fretlink/pronto-hlint.git] / spec / spec_helper.rb
index b3d85969215cd4beaff60c71a8a47755ff961db0..c05f072713d6495f48745d4385c38e336db9b8f2 100644 (file)
@@ -17,10 +17,9 @@ require 'pronto/eslint_npm'
 end
 
 RSpec.shared_context 'with config', config: true do
-  requested_config = metadata[:config].to_yaml
+  requested_config = metadata[:config]
 
-  let(:config_path) { File.join(repo.path.to_s, Pronto::ESLintNpm::CONFIG_FILE) }
-
-  before(:each) { File.write(config_path, requested_config) }
-  after(:each) { FileUtils.rm(config_path) }
+  before(:each) do
+    allow_any_instance_of(Pronto::ESLintNpm).to receive(:config_options).and_return(requested_config)
+  end
 end