]> git.immae.eu Git - github/fretlink/pronto-hlint.git/blobdiff - spec/spec_helper.rb
depend on pronto ~> 0.9.1
[github/fretlink/pronto-hlint.git] / spec / spec_helper.rb
index 23f22e88925f6a0b12a8e3e3683394e0b22e2cc0..c13fe98e8cc9f0be2e677cf65cb7917a2fd0ba91 100644 (file)
@@ -1,5 +1,6 @@
+require 'fileutils'
+require 'byebug'
 require 'rspec'
-require 'rspec/its'
 require 'pronto/eslint_npm'
 
 %w(test eslintignore).each do |repo_name|
@@ -13,7 +14,11 @@ require 'pronto/eslint_npm'
   end
 end
 
-RSpec.configure do |config|
-  config.expect_with(:rspec) { |c| c.syntax = :should }
-  config.mock_with(:rspec) { |c| c.syntax = :should }
+RSpec.shared_context 'with config', config: true do
+  requested_config = metadata[:config].to_yaml
+
+  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) }
 end