]>
git.immae.eu Git - github/fretlink/pronto-hlint.git/blob - spec/spec_helper.rb
1 # frozen_string_literal: true
6 require 'pronto/eslint_npm'
8 %w
[test eslintignore
].each
do |repo_name
|
9 RSpec
.shared_context
"#{repo_name} repo" do
10 let(:git) { "spec/fixtures/#{repo_name}.git/git" }
11 let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" }
13 before
{ FileUtils
.mv(git
, dot_git
) }
14 let(:repo) { Pronto
::Git::Repository.new("spec/fixtures/#{repo_name}.git") }
15 after
{ FileUtils
.mv(dot_git
, git
) }
19 RSpec
.shared_context
'with config', config
: true do
20 requested_config
= metadata
[:config]
23 allow_any_instance_of(Pronto
::ESLintNpm).to
receive(:config_options).and_return(requested_config
)
25 # make sure the config is actually read in the example
26 expect_any_instance_of(Pronto
::ESLintNpm).to
receive(:read_config).and_call_original