Skip to content

Commit dcb6671

Browse files
committed
Merge branch 'activesupport_concern' into 2025-07-02
2 parents f6853ce + 4bccb96 commit dcb6671

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

lib/solargraph/pin_cache.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'yard-activesupport-concern'
12
require 'fileutils'
23
require 'rbs'
34

spec/shell_spec.rb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
require 'tmpdir'
2+
require 'open3'
3+
4+
describe Solargraph::Shell do
5+
before do
6+
@temp_dir = Dir.mktmpdir
7+
File.open(File.join(@temp_dir, 'Gemfile'), 'w') do |file|
8+
file.puts "source 'https://rubygems.org'"
9+
file.puts "gem 'solargraph', path: #{File.expand_path('../..', __FILE__)}"
10+
end
11+
output, status = Open3.capture2e("bundle install", chdir: @temp_dir)
12+
expect(status.success?).to eq(true), ->{ "Bundle install failed: output=#{output}" }
13+
end
14+
15+
def bundle_exec(*cmd)
16+
# run the command in the temporary directory with bundle exec
17+
output, status = Open3.capture2e("bundle exec #{cmd.join(' ')}", chdir: @temp_dir)
18+
expect(status.success?).to eq(true), "Command failed: #{output}"
19+
output
20+
end
21+
22+
after do
23+
# remove the temporary directory after the tests
24+
FileUtils.remove_entry(@temp_dir) if Dir.exist?(@temp_dir)
25+
end
26+
27+
describe "--version" do
28+
it "returns a version when run" do
29+
output = bundle_exec("solargraph", "--version")
30+
31+
expect(output).to_not be_empty
32+
expect(output).to eq (Solargraph::VERSION + "\n")
33+
end
34+
end
35+
36+
describe "uncache" do
37+
it "uncaches without erroring out" do
38+
output = bundle_exec("solargraph", "uncache", "solargraph")
39+
40+
expect(output).to include('Clearing pin cache in')
41+
end
42+
end
43+
end

0 commit comments

Comments
 (0)