X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=spec%2Fspec_helper.rb;h=c13fe98e8cc9f0be2e677cf65cb7917a2fd0ba91;hb=4a987577795e16e2d477207b8edb124b0716ce1c;hp=23f22e88925f6a0b12a8e3e3683394e0b22e2cc0;hpb=126fe1e2579c3fc33a410278c73dc6620d5d3110;p=github%2Ffretlink%2Fpronto-hlint.git diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 23f22e8..c13fe98 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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