Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- repo: https://github.com/mattlqx/pre-commit-ruby
rev: v1.3.3
hooks:
- id: rubocop
- id: rspec
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gem 'bootsnap', '>= 1.4.4', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails', '~> 5.0.0'
end

group :development do
Expand All @@ -43,7 +44,10 @@ group :development do
gem 'rack-mini-profiler', '~> 2.0'
gem 'listen', '~> 3.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring

gem 'spring'
gem 'rubocop', require: false

end

group :test do
Expand All @@ -52,6 +56,8 @@ group :test do
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
gem 'simplecov', require: false
gem 'simplecov_json_formatter'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
48 changes: 48 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
bindex (0.8.1)
bootsnap (1.7.5)
msgpack (~> 1.0)
Expand All @@ -86,6 +87,8 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.1.9)
crass (1.0.6)
diff-lcs (1.4.4)
docile (1.4.0)
erubi (1.10.0)
ffi (1.15.3)
globalid (0.4.2)
Expand Down Expand Up @@ -113,6 +116,9 @@ GEM
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
parallel (1.20.1)
parser (3.0.1.1)
ast (~> 2.4.1)
pg (1.2.3)
pry (0.14.1)
coderay (~> 1.1)
Expand Down Expand Up @@ -154,11 +160,42 @@ GEM
method_source
rake (>= 0.13)
thor (~> 1.0)
rainbow (3.0.0)
rake (13.0.6)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.1.1)
rexml (3.2.5)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-rails (5.0.1)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
rspec-core (~> 3.10)
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.2)
rubocop (1.16.1)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.7.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.7.0)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
rubyzip (2.3.2)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
Expand All @@ -174,6 +211,12 @@ GEM
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
spring (2.1.1)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
Expand All @@ -189,6 +232,7 @@ GEM
turbolinks-source (5.2.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (2.0.0)
web-console (4.1.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -225,8 +269,12 @@ DEPENDENCIES
puma (~> 5.0)
rack-mini-profiler (~> 2.0)
rails (~> 6.1.3, >= 6.1.3.2)
rspec-rails (~> 5.0.0)
rubocop
sass-rails (>= 6)
selenium-webdriver
simplecov
simplecov_json_formatter
spring
turbolinks (~> 5)
tzinfo-data
Expand Down
5 changes: 5 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
class User < ApplicationRecord
validates :name, presence: true

def name
"name"
end
end
8 changes: 8 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env ruby

load File.expand_path("spring", __dir__)
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative "../config/boot"

if ENV['RAILS_ENV'] == 'test'
require 'simplecov'
SimpleCov.start 'rails'
puts "required simplecov"
end

require "rails/commands"
5 changes: 5 additions & 0 deletions coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"result": {
"line": 6.48
}
}
225 changes: 225 additions & 0 deletions coverage/.resultset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
{
"RSpec": {
"coverage": {
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/helpers/application_helper.rb": {
"lines": [
1,
null
]
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/helpers/users_helper.rb": {
"lines": [
1,
null
]
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/models/user.rb": {
"lines": [
1,
1,
null,
1,
0,
null,
null
]
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/models/application_record.rb": {
"lines": [
1,
1,
null
]
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/mailers/application_mailer.rb": {
"lines": [
0,
0,
0,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/decorators/user_decorator.rb": {
"lines": [
0,
0,
0,
null,
0,
0,
0,
0,
0,
0,
0,
null,
null,
0,
null,
0,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/serializers/user_serializer.rb": {
"lines": [
0,
0,
null,
0,
0,
0,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/jobs/application_job.rb": {
"lines": [
0,
null,
null,
null,
null,
null,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/controllers/application_controller.rb": {
"lines": [
0,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/controllers/users_controller.rb": {
"lines": [
0,
0,
null,
null,
0,
0,
null,
0,
0,
0,
null,
0,
0,
null,
null,
0,
0,
null,
null,
0,
0,
0,
null,
null,
0,
0,
null,
null,
0,
0,
0,
null,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
null,
null,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
null,
null,
0,
0,
0,
0,
0,
0,
0,
null,
0,
null,
0,
0,
0,
null,
null,
0,
0,
0,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/services/user_service.rb": {
"lines": [
0,
null,
0,
null,
0,
0,
0,
null,
0,
0,
0,
0,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/channels/application_cable/connection.rb": {
"lines": [
0,
0,
0,
0
],
"branches": {
}
},
"/Users/sameeragayan/workspace/r_and_d/sampleapp/app/channels/application_cable/channel.rb": {
"lines": [
0,
0,
0,
0
],
"branches": {
}
}
},
"timestamp": 1627731448
}
}
Empty file added coverage/.resultset.json.lock
Empty file.
Loading