Skip to content

Commit 965ba1e

Browse files
committed
Set up test suite
1 parent 823b92d commit 965ba1e

Some content is hidden

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

69 files changed

+1353
-22
lines changed

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.bundle/
22
log/*.log
33
pkg/
4-
test/dummy/db/*.sqlite3
5-
test/dummy/db/*.sqlite3-journal
6-
test/dummy/log/*.log
7-
test/dummy/tmp/
4+
spec/dummy/db/*.sqlite3
5+
spec/dummy/db/*.sqlite3-journal
6+
spec/dummy/log/*.log
7+
spec/dummy/tmp/

.rspec

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

.rubocop.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
AllCops:
2+
TargetRubyVersion: 2.3
3+
Exclude:
4+
- 'bin/*'
5+
- 'config/**/*'
6+
- 'config.ru'
7+
- 'db/**/*'
8+
- 'deploy/*'
9+
- 'vendor/**/*'
10+
- 'spec/dummy/**/*'
11+
12+
Rails:
13+
Enabled: true
14+
15+
# Don't be picky about parameter alignment
16+
#
17+
Layout/AlignParameters:
18+
Enabled: false
19+
20+
# Don't be picky about paren alignment
21+
#
22+
Layout/ClosingParenthesisIndentation:
23+
Enabled: false
24+
25+
# It's ok to have an empty line at the top of a class, module, or block
26+
#
27+
Layout/EmptyLinesAroundClassBody:
28+
Enabled: false
29+
Layout/EmptyLinesAroundModuleBody:
30+
Enabled: false
31+
Layout/EmptyLinesAroundBlockBody:
32+
Enabled: false
33+
34+
# Don't try to align parens in a multiline method call
35+
#
36+
Layout/MultilineMethodCallBraceLayout:
37+
Enabled: false
38+
39+
# Don't enforce block length in specs or other files where blocks tend to be long
40+
#
41+
Metrics/BlockLength:
42+
Exclude:
43+
- 'Rakefile'
44+
- '**/*.rake'
45+
- 'spec/**/*.rb'
46+
- '*.gemspec'
47+
48+
# Enable 20 lines in a method instead of the default 10
49+
#
50+
Metrics/MethodLength:
51+
Enabled: true
52+
Max: 20
53+
54+
# Enable a little more complexity than the standard 15
55+
#
56+
Metrics/AbcSize:
57+
Max: 23
58+
59+
# Don't complain about long classes just yet
60+
#
61+
Metrics/ClassLength:
62+
Enabled: false
63+
64+
# The standard 80 character length can be difficult in Ruby at times
65+
#
66+
Metrics/LineLength:
67+
Max: 120
68+
69+
# Allow using Foo::Bar style class declaration style
70+
#
71+
Style/ClassAndModuleChildren:
72+
Enabled: false
73+
74+
# I agree that documentation is good, but it should not be required in all cases
75+
#
76+
Style/Documentation:
77+
Enabled: false
78+
79+
# Dont require empty methods are on a single line
80+
#
81+
Style/EmptyMethod:
82+
Enabled: false
83+
84+
# While this is intended to aid upgrading, adding frozen_string_literal: true to the top of
85+
# every file is awful
86+
#
87+
Style/FrozenStringLiteralComment:
88+
Enabled: false
89+
90+
# Don't enforce a guard clause on short methods
91+
#
92+
Style/GuardClause:
93+
MinBodyLength: 3
94+
95+
# I like using parens because it makes the intention clear that you are calling a method
96+
#
97+
Style/MethodCallWithoutArgsParentheses:
98+
Enabled: false
99+
100+
# Explicit returns are fine
101+
#
102+
Style/RedundantReturn:
103+
Enabled: false
104+
105+
# Allow normal arrays of symbols
106+
#
107+
Style/SymbolArray:
108+
Enabled: false
109+
110+
# Allow normal word arrays
111+
#
112+
Style/WordArray:
113+
Enabled: false

Gemfile.lock

+170
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
PATH
2+
remote: .
3+
specs:
4+
sortable_by (0.1.0)
5+
rails (>= 5.1.2)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
actioncable (5.1.2)
11+
actionpack (= 5.1.2)
12+
nio4r (~> 2.0)
13+
websocket-driver (~> 0.6.1)
14+
actionmailer (5.1.2)
15+
actionpack (= 5.1.2)
16+
actionview (= 5.1.2)
17+
activejob (= 5.1.2)
18+
mail (~> 2.5, >= 2.5.4)
19+
rails-dom-testing (~> 2.0)
20+
actionpack (5.1.2)
21+
actionview (= 5.1.2)
22+
activesupport (= 5.1.2)
23+
rack (~> 2.0)
24+
rack-test (~> 0.6.3)
25+
rails-dom-testing (~> 2.0)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
27+
actionview (5.1.2)
28+
activesupport (= 5.1.2)
29+
builder (~> 3.1)
30+
erubi (~> 1.4)
31+
rails-dom-testing (~> 2.0)
32+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
33+
activejob (5.1.2)
34+
activesupport (= 5.1.2)
35+
globalid (>= 0.3.6)
36+
activemodel (5.1.2)
37+
activesupport (= 5.1.2)
38+
activerecord (5.1.2)
39+
activemodel (= 5.1.2)
40+
activesupport (= 5.1.2)
41+
arel (~> 8.0)
42+
activesupport (5.1.2)
43+
concurrent-ruby (~> 1.0, >= 1.0.2)
44+
i18n (~> 0.7)
45+
minitest (~> 5.1)
46+
tzinfo (~> 1.1)
47+
arel (8.0.0)
48+
ast (2.3.0)
49+
builder (3.2.3)
50+
concurrent-ruby (1.0.5)
51+
database_cleaner (1.6.1)
52+
diff-lcs (1.3)
53+
docile (1.1.5)
54+
erubi (1.6.1)
55+
factory_girl (4.8.0)
56+
activesupport (>= 3.0.0)
57+
factory_girl_rails (4.8.0)
58+
factory_girl (~> 4.8.0)
59+
railties (>= 3.0.0)
60+
globalid (0.4.0)
61+
activesupport (>= 4.2.0)
62+
i18n (0.8.6)
63+
json (2.1.0)
64+
loofah (2.0.3)
65+
nokogiri (>= 1.5.9)
66+
mail (2.6.6)
67+
mime-types (>= 1.16, < 4)
68+
method_source (0.8.2)
69+
mime-types (3.1)
70+
mime-types-data (~> 3.2015)
71+
mime-types-data (3.2016.0521)
72+
mini_portile2 (2.2.0)
73+
minitest (5.10.3)
74+
nio4r (2.1.0)
75+
nokogiri (1.8.0)
76+
mini_portile2 (~> 2.2.0)
77+
parallel (1.12.0)
78+
parser (2.4.0.0)
79+
ast (~> 2.2)
80+
pg (0.21.0)
81+
powerpack (0.1.1)
82+
rack (2.0.3)
83+
rack-test (0.6.3)
84+
rack (>= 1.0)
85+
rails (5.1.2)
86+
actioncable (= 5.1.2)
87+
actionmailer (= 5.1.2)
88+
actionpack (= 5.1.2)
89+
actionview (= 5.1.2)
90+
activejob (= 5.1.2)
91+
activemodel (= 5.1.2)
92+
activerecord (= 5.1.2)
93+
activesupport (= 5.1.2)
94+
bundler (>= 1.3.0, < 2.0)
95+
railties (= 5.1.2)
96+
sprockets-rails (>= 2.0.0)
97+
rails-dom-testing (2.0.3)
98+
activesupport (>= 4.2.0)
99+
nokogiri (>= 1.6)
100+
rails-html-sanitizer (1.0.3)
101+
loofah (~> 2.0)
102+
railties (5.1.2)
103+
actionpack (= 5.1.2)
104+
activesupport (= 5.1.2)
105+
method_source
106+
rake (>= 0.8.7)
107+
thor (>= 0.18.1, < 2.0)
108+
rainbow (2.2.2)
109+
rake
110+
rake (12.0.0)
111+
rspec-core (3.6.0)
112+
rspec-support (~> 3.6.0)
113+
rspec-expectations (3.6.0)
114+
diff-lcs (>= 1.2.0, < 2.0)
115+
rspec-support (~> 3.6.0)
116+
rspec-mocks (3.6.0)
117+
diff-lcs (>= 1.2.0, < 2.0)
118+
rspec-support (~> 3.6.0)
119+
rspec-rails (3.6.0)
120+
actionpack (>= 3.0)
121+
activesupport (>= 3.0)
122+
railties (>= 3.0)
123+
rspec-core (~> 3.6.0)
124+
rspec-expectations (~> 3.6.0)
125+
rspec-mocks (~> 3.6.0)
126+
rspec-support (~> 3.6.0)
127+
rspec-support (3.6.0)
128+
rubocop (0.49.1)
129+
parallel (~> 1.10)
130+
parser (>= 2.3.3.1, < 3.0)
131+
powerpack (~> 0.1)
132+
rainbow (>= 1.99.1, < 3.0)
133+
ruby-progressbar (~> 1.7)
134+
unicode-display_width (~> 1.0, >= 1.0.1)
135+
ruby-progressbar (1.8.1)
136+
simplecov (0.14.1)
137+
docile (~> 1.1.0)
138+
json (>= 1.8, < 3)
139+
simplecov-html (~> 0.10.0)
140+
simplecov-html (0.10.1)
141+
sprockets (3.7.1)
142+
concurrent-ruby (~> 1.0)
143+
rack (> 1, < 3)
144+
sprockets-rails (3.2.0)
145+
actionpack (>= 4.0)
146+
activesupport (>= 4.0)
147+
sprockets (>= 3.0.0)
148+
thor (0.19.4)
149+
thread_safe (0.3.6)
150+
tzinfo (1.2.3)
151+
thread_safe (~> 0.1)
152+
unicode-display_width (1.3.0)
153+
websocket-driver (0.6.5)
154+
websocket-extensions (>= 0.1.0)
155+
websocket-extensions (0.1.2)
156+
157+
PLATFORMS
158+
ruby
159+
160+
DEPENDENCIES
161+
database_cleaner
162+
factory_girl_rails
163+
pg
164+
rspec-rails
165+
rubocop
166+
simplecov
167+
sortable_by!
168+
169+
BUNDLED WITH
170+
1.15.3

Rakefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
1414
rdoc.rdoc_files.include('lib/**/*.rb')
1515
end
1616

17-
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
17+
APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
1818
load 'rails/tasks/engine.rake'
1919

20-
2120
load 'rails/tasks/statistics.rake'
2221

23-
24-
2522
require 'bundler/gem_tasks'
2623

2724
require 'rake/testtask'
@@ -32,5 +29,4 @@ Rake::TestTask.new(:test) do |t|
3229
t.verbose = false
3330
end
3431

35-
3632
task default: :test

bin/rails

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
ENGINE_ROOT = File.expand_path('../..', __FILE__)
66
ENGINE_PATH = File.expand_path('../../lib/sortable_by/engine', __FILE__)
7-
APP_PATH = File.expand_path('../../test/dummy/config/application', __FILE__)
7+
APP_PATH = File.expand_path('../../spec/dummy/config/application', __FILE__)
88

99
# Set up gems listed in the Gemfile.
1010
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

bin/rspec

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
#
4+
# This file was generated by Bundler.
5+
#
6+
# The application 'rspec' is installed as part of a gem, and
7+
# this file is here to facilitate running it.
8+
#
9+
10+
require "pathname"
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12+
Pathname.new(__FILE__).realpath)
13+
14+
require "rubygems"
15+
require "bundler/setup"
16+
17+
load Gem.bin_path("rspec-core", "rspec")

bin/rubocop

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
#
4+
# This file was generated by Bundler.
5+
#
6+
# The application 'rubocop' is installed as part of a gem, and
7+
# this file is here to facilitate running it.
8+
#
9+
10+
require "pathname"
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12+
Pathname.new(__FILE__).realpath)
13+
14+
require "rubygems"
15+
require "bundler/setup"
16+
17+
load Gem.bin_path("rubocop", "rubocop")

0 commit comments

Comments
 (0)