Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lstacul/appraisal #10

Merged
merged 3 commits into from
Jan 5, 2024
Merged
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
Binary file removed .DS_Store
Binary file not shown.
62 changes: 46 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,59 @@
---
name: Ruby

on:
push:
branches:
- master

pull_request:

jobs:
test:
lint:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
name: Lint
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
bundler-cache: true
- name: Linter
run: bundle exec rake standard
test-old-rails:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} - Rails ${{ matrix.rails }}
strategy:
fail-fast: false
matrix:
ruby:
- '2.6.10'
- '2.7.6'

ruby: ['2.7']
rails: ['4', '5']
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run specs
run: bundle exec appraisal rails-${{ matrix.rails }} rake
test-new-rails:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} - Rails ${{ matrix.rails }}
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1', '3.2', '3.3']
rails: ['6', '7']
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run specs
run: bundle exec appraisal rails-${{ matrix.rails }} rake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.rbenv-gemsets
.ruby-version
.rspec_status
gemfiles/.bundle/
100 changes: 100 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
inherit_from: .rubocop_todo.yml

require:
- standard
- rubocop-rspec
- rubocop-rake

inherit_gem:
standard: config/base.yml

Capybara/ClickLinkOrButtonStyle: # new in 2.19
Enabled: false
Capybara/MatchStyle: # new in 2.17
Enabled: false
Capybara/NegationMatcher: # new in 2.14
Enabled: false
Capybara/RedundantWithinFind: # new in 2.20
Enabled: false
Capybara/SpecificActions: # new in 2.14
Enabled: false
Capybara/SpecificFinders: # new in 2.13
Enabled: false
Capybara/SpecificMatcher: # new in 2.12
Enabled: false
Capybara/RSpec/HaveSelector: # new in 2.19
Enabled: false
Capybara/RSpec/PredicateMatcher: # new in 2.19
Enabled: false
FactoryBot/AssociationStyle: # new in 2.23
Enabled: false
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
Enabled: false
FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
Enabled: false
FactoryBot/FactoryNameStyle: # new in 2.16
Enabled: false
FactoryBot/IdSequence: # new in <<next>>
Enabled: false
FactoryBot/RedundantFactoryOption: # new in 2.23
Enabled: false
FactoryBot/SyntaxMethods: # new in 2.7
Enabled: false
RSpec/BeEmpty: # new in 2.20
Enabled: true
RSpec/BeEq: # new in 2.9.0
Enabled: true
RSpec/BeNil: # new in 2.9.0
Enabled: true
RSpec/ChangeByZero: # new in 2.11
Enabled: true
RSpec/ContainExactly: # new in 2.19
Enabled: true
RSpec/DuplicatedMetadata: # new in 2.16
Enabled: true
RSpec/EmptyMetadata: # new in 2.24
Enabled: true
RSpec/Eq: # new in 2.24
Enabled: true
RSpec/ExcessiveDocstringSpacing: # new in 2.5
Enabled: true
RSpec/IdenticalEqualityAssertion: # new in 2.4
Enabled: true
RSpec/IndexedLet: # new in 2.20
Enabled: true
RSpec/MatchArray: # new in 2.19
Enabled: true
RSpec/MetadataStyle: # new in 2.24
Enabled: true
RSpec/NoExpectationExample: # new in 2.13
Enabled: true
RSpec/PendingWithoutReason: # new in 2.16
Enabled: true
RSpec/ReceiveMessages: # new in 2.23
Enabled: true
RSpec/RedundantAround: # new in 2.19
Enabled: true
RSpec/SkipBlockInsideExample: # new in 2.19
Enabled: true
RSpec/SortMetadata: # new in 2.14
Enabled: true
RSpec/SpecFilePathFormat: # new in 2.24
Enabled: true
RSpec/SpecFilePathSuffix: # new in 2.24
Enabled: true
RSpec/SubjectDeclaration: # new in 2.5
Enabled: true
RSpec/VerifiedDoubleReference: # new in 2.10.0
Enabled: true
RSpec/Rails/AvoidSetupHook: # new in 2.4
Enabled: true
RSpec/Rails/HaveHttpStatus: # new in 2.12
Enabled: true
RSpec/Rails/InferredSpecType: # new in 2.14
Enabled: true
RSpec/Rails/MinitestAssertions: # new in 2.17
Enabled: true
RSpec/Rails/NegationBeValid: # new in 2.23
Enabled: true
RSpec/Rails/TravelAround: # new in 2.19
Enabled: true
89 changes: 89 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-01-04 11:01:13 UTC using RuboCop version 1.59.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Exclude:
- 'spec/outcome_spec.rb'

# Offense count: 8
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/outcome_spec.rb'
- 'spec/validation_spec.rb'

# Offense count: 7
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Exclude:
- 'spec/outcome_spec.rb'
- 'spec/step_spec.rb'

# Offense count: 5
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 8

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExpectActual:
Exclude:
- '**/spec/routing/**/*'
- 'spec/validation_spec.rb'

# Offense count: 5
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Exclude:
- 'spec/hooks_spec.rb'
- 'spec/outcome_spec.rb'
- 'spec/sequence_spec.rb'
- 'spec/step_spec.rb'
- 'spec/validation_spec.rb'

# Offense count: 9
RSpec/MultipleExpectations:
Max: 6

# Offense count: 10
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Exclude:
- 'spec/outcome_spec.rb'
- 'spec/validation_spec.rb'

# Offense count: 4
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 4

# Offense count: 5
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- '**/spec/routing/**/*'
- 'spec/hooks_spec.rb'
- 'spec/outcome_spec.rb'
- 'spec/sequence_spec.rb'
- 'spec/step_spec.rb'
- 'spec/validation_spec.rb'

# Offense count: 4
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/tzu_spec.rb'
- 'spec/validation_spec.rb'
15 changes: 15 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appraise "rails-4" do
gem "activemodel", "4.2.11.3"
end

appraise "rails-5" do
gem "activemodel", "~> 5.2"
end

appraise "rails-6" do
gem "activemodel", "~> 6.1"
end

appraise "rails-7" do
gem "activemodel", "~> 7.1"
end
13 changes: 13 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
source "http://rubygems.org"

gemspec

gem "activemodel"
gem "debug"
gem "irb"
gem "rake"
gem "rspec"
gem "rubocop-rspec"
gem "rubocop-rake"
gem "standard"
gem "virtus"

gem "appraisal", "~> 2.5"
Loading