Skip to content

Commit

Permalink
Added Rspec and Appraisals with minor tweaks
Browse files Browse the repository at this point in the history
Added Rspec and Appraisals with minor tweaks

Added Rspec and Appraisals

Updated gitignore

Updated Appraisals gemfiles
  • Loading branch information
a-figueiredo-campos committed Feb 3, 2023
1 parent 7e7cce1 commit 8ca4989
Show file tree
Hide file tree
Showing 125 changed files with 1,811 additions and 10,325 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/
spec/dummy/db/*.sqlite3
spec/dummy/log/*.log
spec/dummy/tmp/
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format progress
--color
--require spec_helper
11 changes: 11 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

appraise 'rails-6' do
gem 'rails', '>= 6', '< 7'
gem 'railties', '>= 6', '< 7'
end

appraise 'rails-7' do
gem 'rails', '>= 7'
gem 'railties', '>= 7'
end
66 changes: 64 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,40 @@ GEM
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
builder (3.2.4)
byebug (11.1.3)
concurrent-ruby (1.2.0)
crass (1.0.6)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.1)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.3)
diff-lcs (1.5.0)
erubi (1.12.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (3.1.0)
i18n (>= 1.8.11, < 2)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
json (2.6.3)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.8.0.1)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
Expand All @@ -112,6 +131,9 @@ GEM
nokogiri (1.14.1)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.22.1)
parser (3.2.0.0)
ast (~> 2.4.1)
psych (5.0.2)
stringio
racc (1.6.2)
Expand Down Expand Up @@ -144,17 +166,51 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
rdoc (6.5.0)
psych (>= 4.0.0)
regexp_parser (2.6.2)
rexml (3.2.5)
rspec-core (3.12.1)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.1)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-core (~> 3.11)
rspec-expectations (~> 3.11)
rspec-mocks (~> 3.11)
rspec-support (~> 3.11)
rspec-support (3.12.0)
rubocop (1.44.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
sqlite3 (1.6.0)
mini_portile2 (~> 2.8.0)
stringio (3.0.4)
stringio (3.0.5)
thor (1.2.1)
timeout (0.3.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -164,10 +220,16 @@ PLATFORMS
ruby

DEPENDENCIES
appraisal
byebug
database_cleaner
factory_bot_rails
faker
mocha
rake
rdoc
rspec-rails
rubocop
sqlite3
survey!

Expand Down
14 changes: 4 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true

require 'rubygems'
begin
require 'bundler/setup'
Expand All @@ -11,14 +12,7 @@ require 'rdoc/task'

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end

task :default => :test
task default: :test

Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
Expand All @@ -27,4 +21,4 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.include('app/**/*.rb')
end
end
5 changes: 2 additions & 3 deletions app/models/survey/option.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ def correct?

private

def default_option_weight
weight = 1 if weight && correct? && weight.zero?
weight
def default_option_weight(current = self)
current.weight = 1 if correct? && current.weight.zero?
end
end
end
13 changes: 13 additions & 0 deletions gemfiles/rails_6.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rdoc"
gem "rails", ">= 6", "< 7"
gem "railties", ">= 6", "< 7"

group :test do
gem "sqlite3"
end

gemspec path: "../"
Loading

0 comments on commit 8ca4989

Please sign in to comment.