Skip to content

Commit a6e059c

Browse files
authored
Merge pull request #10 from fastruby/add-basic-coverage
Add basic coverage to RailsStats::CodeStatistics#to_s
2 parents 3e1249c + c0bacb8 commit a6e059c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+877
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
See stuff about a Rails app.
44

55
There were a few things missing to the included `rake stats`
6+
67
RailsStats mainly adds the ability to be run from outside the project in question. This can be helpful if the app you are interested in can not be booted for some reason.
78

89
### Run it outside Rails project
@@ -257,7 +258,23 @@ Directory: /users/brian/examples/spree
257258
| Total | 56347 | 44503 | 341 | 2317 | 6 | 17 |
258259
+----------------------+-------+-------+---------+---------+-----+-------+
259260
Code LOC: 17870 Test LOC: 26633 Code to Test Ratio: 1:1.5
260-
261+
262+
```
263+
264+
### Testing
265+
266+
In order to run the tests for this gem:
267+
268+
```bash
269+
bundle exec rake
270+
271+
# Running:
272+
273+
.
274+
275+
Fabulous run in 0.013349s, 74.9120 runs/s, 74.9120 assertions/s.
276+
277+
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
261278
```
262279

263280
### TODO

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
require "bundler/gem_tasks"
4+
require "rake/testtask"
15
require "rails_stats"
6+
7+
Rake::TestTask.new do |task|
8+
task.libs.push "lib"
9+
task.libs.push "test"
10+
task.pattern = "test/**/*_test.rb"
11+
end
12+
13+
task default: %i[test]

rails_stats.gemspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ Gem::Specification.new do |spec|
2020

2121
spec.add_dependency "rake"
2222
spec.add_development_dependency "bundler", ">= 1.6", "< 3.0"
23+
spec.add_development_dependency "byebug"
24+
spec.add_development_dependency "minitest"
25+
spec.add_development_dependency "minitest-around"
2326
end

test/dummy/Gemfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
source 'https://rubygems.org'
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
ruby '2.6.3'
5+
6+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7+
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
8+
# Use Puma as the app server
9+
gem 'puma', '~> 4.1'
10+
# Use SCSS for stylesheets
11+
gem "sass-rails"
12+
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
13+
gem 'webpacker', '~> 4.0'
14+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
15+
gem 'jbuilder', '~> 2.7'
16+
# Use Redis adapter to run Action Cable in production
17+
# gem 'redis', '~> 4.0'
18+
# Use Active Model has_secure_password
19+
# gem 'bcrypt', '~> 3.1.7'
20+
21+
# Use Active Storage variant
22+
# gem 'image_processing', '~> 1.2'
23+
24+
# Reduces boot times through caching; required in config/boot.rb
25+
gem 'bootsnap', '>= 1.4.2', require: false
26+
27+
group :development, :test do
28+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
29+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
30+
end
31+
32+
group :development do
33+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
34+
gem 'web-console', '>= 3.3.0'
35+
gem 'listen', '~> 3.2'
36+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
37+
gem 'spring'
38+
gem 'spring-watcher-listen', '~> 2.0.0'
39+
end
40+
41+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
42+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

test/dummy/Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//= link_tree ../images
2+
//= link_directory ../stylesheets .css

test/dummy/app/assets/images/.keep

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Channel < ActionCable::Channel::Base
3+
end
4+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Connection < ActionCable::Connection::Base
3+
end
4+
end

0 commit comments

Comments
 (0)