Skip to content

Commit 92ca317

Browse files
julioalucerohmdros
authored andcommitted
Updates test and dummy app with models and schema.rb
1 parent 7d76a7a commit 92ca317

File tree

7 files changed

+31
-14
lines changed

7 files changed

+31
-14
lines changed

lib/rails_stats/json_formatter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ def schema_info
8787
end
8888
end
8989
end
90-
end
90+
end

test/dummy/app/models/comment.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Comments < ApplicationRecord
2+
belongs_to :commentable, polymorphic: true
3+
end

test/dummy/app/models/pet.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Pets < User
2+
end

test/dummy/app/models/user.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Users < ApplicationRecord
2+
end

test/dummy/db/schema.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
ActiveRecord::Schema[7.0].define(version: 2023_04_25_154701) do
3+
create_table "users", force: :cascade do |t|
4+
t.string "email"
5+
end
6+
create_table "comments", force: :cascade do |t|
7+
t.bigint :commentable_id
8+
t.string :commentable_type
9+
end
10+
end

test/fixtures/console-output.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
| simplecov-console | 8 | 3 |
55
| codecov | 4 | 1 |
66
| rails_stats | 4 | 2 |
7-
| simplecov | 3 | 3 |
8-
| minitest-around | 1 | 1 |
9-
| bundler | 0 | 0 |
7+
| listen | 3 | 2 |
8+
| bootsnap | 1 | 1 |
9+
| puma | 1 | 1 |
1010
| byebug | 0 | 0 |
11-
| minitest | 0 | 0 |
12-
| minitest-spec-context | 0 | 0 |
11+
| spring | 0 | 0 |
12+
| tzinfo-data | 0 | 0 |
1313
+-----------------------|------------|----------------+
1414

1515
Declared Gems 9
@@ -29,16 +29,16 @@
2929
| Libraries | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
3030
| Mailers | 1 | 4 | 4 | 1 | 0 | 0 | 0 |
3131
| Model Tests | 2 | 5 | 4 | 2 | 0 | 0 | 0 |
32-
| Models | 1 | 3 | 3 | 1 | 0 | 0 | 0 |
32+
| Models | 4 | 10 | 10 | 4 | 0 | 0 | 0 |
3333
| Spec Support | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
3434
| Test Support | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
3535
+----------------------+---------+---------+---------+---------+---------+-----+-------+
36-
| Code | 30 | 477 | 145 | 7 | 1 | 0 | 143 |
36+
| Code | 33 | 486 | 154 | 10 | 1 | 0 | 152 |
3737
| Tests | 4 | 7 | 6 | 2 | 0 | 0 | 0 |
38-
| Total | 34 | 484 | 151 | 9 | 1 | 0 | 149 |
38+
| Total | 37 | 493 | 160 | 12 | 1 | 0 | 158 |
3939
+----------------------+---------+---------+---------+---------+---------+-----+-------+
40-
Code LOC: 145 Test LOC: 6 Code to Test Ratio: 1:0.0 Files: 34
40+
Code LOC: 154 Test LOC: 6 Code to Test Ratio: 1:0.0 Files: 37
4141

42-
STI models count: 0 STI classes
43-
Polymorphic models count: 0 polymorphic associations
44-
Schema Stats: No schema.rb or structure.sql file found
42+
STI models count: 1 STI classes
43+
Polymorphic models count: 1 polymorphic associations
44+
Schema Stats: 2 `create_table` calls in schema.rb

test/lib/rails_stats/json_formatter_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,4 @@
284284
assert_equal expectation, result
285285
end
286286
end
287-
end
287+
end

0 commit comments

Comments
 (0)