Skip to content

Commit 3dc80df

Browse files
committed
Log message when the application is initialized
1 parent 8b47c86 commit 3dc80df

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/rails_master_hook_app.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def initialize(run_file: nil, lock_file: nil, logger:)
1313
@run_file = run_file || ENV["RUN_FILE"] || File.expand_path("../run-rails-master-hook", __dir__)
1414
@lock_file = lock_file || ENV["LOCK_FILE"]
1515
@logger = logger
16+
logger.info "Initialized RailsMasterHookApp with run_file=#{@run_file} lock_file=#{@lock_file}"
1617
end
1718

1819
def call(env)

test/integration_test.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
class IntegrationTest < TestCase
66
def test_config_ru_app_behaves_correctly
7-
app, _options = Rack::Builder.parse_file(File.expand_path("../config.ru", __dir__))
7+
capture_io do
8+
app, _options = Rack::Builder.parse_file(File.expand_path("../config.ru", __dir__))
89

9-
env = Rack::MockRequest.env_for("/")
10-
status, headers, body = app.call(env)
10+
env = Rack::MockRequest.env_for("/")
11+
status, headers, body = app.call(env)
1112

12-
assert_equal 200, status
13-
assert_equal "PONG", body.first
14-
assert_equal "text/plain", headers["Content-Type"]
13+
assert_equal 200, status
14+
assert_equal "PONG", body.first
15+
assert_equal "text/plain", headers["Content-Type"]
16+
end
1517
end
1618

1719
def test_config_ru_rails_master_hook_endpoint

0 commit comments

Comments
 (0)