Skip to content

Commit e336fe0

Browse files
committed
Expose port in ocker and use Binary writer to write binary
1 parent 0e2ab60 commit e336fe0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

spec/integration/rails_spec.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@
1414
PORT = 3000
1515

1616
before(:all) do
17-
`docker build -t terminalwire-rails-server -f containers/rails/Dockerfile .`
18-
@docker_id = `docker run -d terminalwire-rails-server`.chomp
17+
`docker buildx -t terminalwire-rails-server -f containers/rails/Dockerfile .`
18+
@docker_id = `docker run -p 3000:#{PORT} -d terminalwire-rails-server`.chomp
1919
wait_for_server("0.0.0.0", PORT)
2020

2121
@path = Pathname.new(Dir.mktmpdir)
2222
@bin_path = @path.join("bin").tap(&:mkdir)
2323

24-
@bin_path.join("hello").tap do |file|
25-
file.write <<~BASH
26-
#!/usr/bin/env terminalwire-exec
27-
url: "http://localhost:#{PORT}/terminal"
28-
BASH
29-
file.chmod(0o755)
30-
end
24+
Terminalwire::Binary.write(
25+
url: "http://localhost:#{PORT}/terminal",
26+
to: @bin_path.join("hello")
27+
)
3128

3229
ENV["PATH"] = "#{@bin_path.to_s}:#{ENV["PATH"]}"
3330

0 commit comments

Comments
 (0)