Skip to content

Commit acaa70d

Browse files
committed
Fixed go: go.mod file not found in current directory or any parent directory in spec
1 parent db3f1d2 commit acaa70d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

_tools/ruby_h_to_go/spec/ruby_h_to_go/cli_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
describe "#perform" do
1414
subject { cli.perform }
1515

16+
before do
17+
FileUtils.cp(File.join(project_root_dir, "go.mod"), temp_dir)
18+
end
19+
1620
it { expect { subject }.not_to raise_error }
1721
end
1822
end

_tools/ruby_h_to_go/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,8 @@
111111
meta[:aggregate_failures] = true
112112
end
113113
end
114+
115+
# @return [String]
116+
def project_root_dir
117+
File.expand_path("../../..", __dir__)
118+
end

0 commit comments

Comments
 (0)