Skip to content

Commit 65b449d

Browse files
authored
Merge pull request #79 from zombocom/schneems/drop-timeout
Reduce timeout to 1 second
2 parents 1a28a81 + 2c97593 commit 65b449d

File tree

4 files changed

+21
-32
lines changed

4 files changed

+21
-32
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## HEAD (unreleased)
22

3+
- Reduce timeout to 1 second (https://github.com/zombocom/dead_end/pull/79)
34
- Logically consecutive lines (such as chained methods are now joined) (https://github.com/zombocom/dead_end/pull/78)
45
- Output improvement for cases where the only line is an single `end` (https://github.com/zombocom/dead_end/pull/78)
56

lib/dead_end/internals.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
module DeadEnd
1515
class Error < StandardError; end
1616
SEARCH_SOURCE_ON_ERROR_DEFAULT = true
17-
TIMEOUT_DEFAULT = ENV.fetch("DEAD_END_TIMEOUT", 5).to_i
17+
TIMEOUT_DEFAULT = ENV.fetch("DEAD_END_TIMEOUT", 1).to_i
1818

1919
def self.handle_error(e, search_source_on_error: SEARCH_SOURCE_ON_ERROR_DEFAULT)
2020
raise e unless e.message.include?("end-of-input")

spec/integration/improvement_regression_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44

55
module DeadEnd
66
RSpec.describe "Library only integration to test regressions and improvements" do
7+
it "returns good results on routes.rb" do
8+
source = fixtures_dir.join("routes.rb.txt").read
9+
10+
io = StringIO.new
11+
DeadEnd.call(
12+
io: io,
13+
source: source,
14+
filename: "none"
15+
)
16+
17+
expect(io.string).to include(<<~'EOM'.indent(4))
18+
1 Rails.application.routes.draw do
19+
❯ 113 namespace :admin do
20+
❯ 116 match "/foobar(*path)", via: :all, to: redirect { |_params, req|
21+
❯ 120 }
22+
121 end
23+
EOM
24+
end
25+
726
it "handles multi-line-methods issues/64" do
827
source = fixtures_dir.join("webmock.rb.txt").read
928

spec/perf/perf_spec.rb

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)