Skip to content

Commit 3b29ceb

Browse files
committed
Use a different expectation for Ruby 2.4?
1 parent 9a9c55f commit 3b29ceb

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

test/lib/rails_stats/code_statistics_test.rb

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,40 @@
88
+-----------------------|------------|----------------+
99
| Name | Total Deps | 1st Level Deps |
1010
+-----------------------|------------|----------------+
11+
| simplecov-console | 7 | 3 |
12+
| codecov | 4 | 1 |
13+
| rails_stats | 4 | 2 |
14+
| simplecov | 3 | 3 |
15+
| minitest-around | 1 | 1 |
16+
| bundler | 0 | 0 |
17+
| byebug | 0 | 0 |
18+
| minitest | 0 | 0 |
19+
| minitest-spec-context | 0 | 0 |
20+
+-----------------------|------------|----------------+
21+
\n Declared Gems 9 \n Total Gems 17 \n Unpinned Versions 8 \n Github Refs 0 \n \n+----------------------+---------+---------+---------+---------+-----+-------+
22+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
23+
+----------------------+---------+---------+---------+---------+-----+-------+
24+
| Channels | 8 | 8 | 2 | 0 | 0 | 0 |
25+
| Configuration | 417 | 111 | 1 | 0 | 0 | 0 |
26+
| Controllers | 7 | 6 | 1 | 1 | 1 | 4 |
27+
| Helpers | 3 | 3 | 0 | 0 | 0 | 0 |
28+
| Javascripts | 27 | 7 | 0 | 0 | 0 | 0 |
29+
| Jobs | 7 | 2 | 1 | 0 | 0 | 0 |
30+
| Mailers | 4 | 4 | 1 | 0 | 0 | 0 |
31+
| Models | 3 | 3 | 1 | 0 | 0 | 0 |
32+
+----------------------+---------+---------+---------+---------+-----+-------+
33+
| Code | 476 | 144 | 7 | 1 | 0 | 142 |
34+
| Tests | 0 | 0 | 0 | 0 | 0 | 0 |
35+
| Total | 476 | 144 | 7 | 1 | 0 | 142 |
36+
+----------------------+---------+---------+---------+---------+-----+-------+
37+
Code LOC: 144 Test LOC: 0 Code to Test Ratio: 1:0.0
38+
39+
EOS
40+
41+
TABLE_RUBY_2_4 = <<~EOS
42+
+-----------------------|------------|----------------+
43+
| Name | Total Deps | 1st Level Deps |
44+
+-----------------------|------------|----------------+
1145
| simplecov-console | 6 | 3 |
1246
| rails_stats | 4 | 2 |
1347
| codecov | 3 | 1 |
@@ -45,7 +79,13 @@
4579
RailsStats::CodeStatistics.new(root_directory).to_s
4680
end
4781

48-
assert_equal TABLE, out
82+
expectation = if RUBY_VERSION < "2.5.0"
83+
TABLE_RUBY_2_4
84+
else
85+
TABLE
86+
end
87+
88+
assert_equal expectation, out
4989
end
5090
end
5191
end

0 commit comments

Comments
 (0)