]>
Commit | Line | Data |
---|---|---|
0ab4d181 MD |
1 | # frozen_string_literal: true |
2 | ||
2add6782 | 3 | require 'fileutils' |
ce89f9ed | 4 | require 'rspec' |
9c1df047 | 5 | require 'pronto/hlint' |
ce89f9ed | 6 | |
9c1df047 | 7 | %w[test].each do |repo_name| |
fb94b0e6 MD |
8 | RSpec.shared_context "#{repo_name} repo" do |
9 | let(:git) { "spec/fixtures/#{repo_name}.git/git" } | |
10 | let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" } | |
ce89f9ed | 11 | |
fb94b0e6 MD |
12 | before { FileUtils.mv(git, dot_git) } |
13 | let(:repo) { Pronto::Git::Repository.new("spec/fixtures/#{repo_name}.git") } | |
14 | after { FileUtils.mv(dot_git, git) } | |
15 | end | |
ce89f9ed | 16 | end |
1845f2e3 MD |
17 | |
18 | RSpec.shared_context 'with config', config: true do | |
c89a62b8 | 19 | requested_config = metadata[:config] |
1845f2e3 | 20 | |
c89a62b8 | 21 | before(:each) do |
9c1df047 | 22 | allow_any_instance_of(Pronto::Hlint::Runner).to receive(:config_options).and_return(requested_config) |
f411af6f MD |
23 | |
24 | # make sure the config is actually read in the example | |
9c1df047 | 25 | expect_any_instance_of(Pronto::Hlint::Runner).to receive(:read_config).and_call_original |
c89a62b8 | 26 | end |
1845f2e3 | 27 | end |