Skip to content

Commit

Permalink
Update RSpec-rails
Browse files Browse the repository at this point in the history
  • Loading branch information
nbulaj committed Mar 25, 2024
1 parent d313481 commit 5a95947
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ jobs:
matrix:
include:
# mongoid7 requires activemodel >= 5.1, < 8.0
- orm: 'mongoid7'
ruby: '2.6'
rails: '6.0'
experimental: false
- orm: 'mongoid7'
ruby: '2.7'
rails: '6.0'
Expand All @@ -36,10 +32,6 @@ jobs:
experimental: false

# mongoid8 requires activemodel >= 5.1, < 8.0
- orm: 'mongoid8'
ruby: '2.6'
rails: '6.0'
experimental: false
- orm: 'mongoid8'
ruby: '2.7'
rails: '6.0'
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ Layout/DotPosition:
Layout/LineLength:
Exclude:
- spec/**/*
Max: 100
Max: 120
13 changes: 10 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ExtensionIntegrator
def self.gsub(filepath, pattern, value)
file = File.read(filepath)
updated_file = file.gsub(pattern, value)
File.open(filepath, 'w') { |line| line.puts(updated_file) }
File.open(filepath, "w") { |line| line.puts(updated_file) }
end
end

Expand All @@ -21,8 +21,15 @@ task :load_doorkeeper do
`cp -r -n doorkeeper/spec .`
`rm -rf spec/generators/` # we are not ActiveRecord
`rm -rf spec/validators/`
ExtensionIntegrator.gsub("spec/spec_helper.rb", 'require "database_cleaner"', "")
ExtensionIntegrator.gsub("spec/models/doorkeeper/application_spec.rb", 'context "when custom model class configured" do', 'xcontext "when custom model class configured" do')
ExtensionIntegrator.gsub(
"spec/spec_helper.rb",
'require "database_cleaner"',
"",
)
ExtensionIntegrator.gsub(
"spec/models/doorkeeper/application_spec.rb",
'context "when custom model class configured" do', 'xcontext "when custom model class configured" do',
)
`bundle exec rspec`
end

Expand Down

0 comments on commit 5a95947

Please sign in to comment.