Skip to content

Commit

Permalink
Merge branch 'bump-build-matrix' into views-ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
calebhearth committed Mar 5, 2024
2 parents ffea8ef + 13c3edd commit 05aa517
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2"]
rails: ["6.1", "7.0"]
ruby: ["3.1", "3.2", "3.3"]
rails: ["6.1", "7.0", "7.1", "main"]
continue-on-error: [false]
exclude:
- ruby: "3.2"
Expand Down
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ source "https://rubygems.org"
# Specify your gem's dependencies in scenic.gemspec
gemspec

rails_version = ENV.fetch("RAILS_VERSION", "6.1")
rails_version = ENV.fetch("RAILS_VERSION", "7.1")

rails_constraint = if rails_version == "master"
rails_constraint = if rails_version == "main"
{github: "rails/rails"}
else
"~> #{rails_version}.0"
end

gem "rails", rails_constraint
gem "sprockets", "< 4.0.0"
gem "pg", "~> 1.1"
gem "activerecord", rails_constraint
gem "railties", rails_constraint
6 changes: 3 additions & 3 deletions scenic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "database_cleaner"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec", ">= 3.3"
spec.add_development_dependency "pg", "~> 0.19"
spec.add_development_dependency "pry"
spec.add_development_dependency "pg", "~> 1.1"
spec.add_development_dependency "ammeter", ">= 1.1.3"
spec.add_development_dependency "yard"
spec.add_development_dependency "redcarpet"
spec.add_development_dependency "standard"
spec.add_development_dependency "sprockets", "< 4.0.0"

spec.add_dependency "activerecord", ">= 4.0.0"
spec.add_dependency "railties", ">= 4.0.0"

spec.required_ruby_version = ">= 2.3.0"
spec.required_ruby_version = ">= 3.1"
end
10 changes: 6 additions & 4 deletions spec/scenic/schema_dumper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class SearchInAHaystack < ActiveRecord::Base

context "with views in non public schemas" do
it "dumps a create_view including namespace for a view in the database" do
Search.connection.create_view :"scenic.searches",
sql_definition: "SELECT 'needle'::text AS haystack"
view_definition = "SELECT 'needle'::text AS haystack"
Search.connection.execute "CREATE SCHEMA IF NOT EXISTS scenic; SET search_path TO scenic, public"
Search.connection.create_view :"scenic.searches", sql_definition: view_definition
stream = StringIO.new

Check failure on line 60 in spec/scenic/schema_dumper_spec.rb

View workflow job for this annotation

GitHub Actions / Lint with Standard

Lint/UselessAssignment: Useless assignment to variable - `stream`.

expect(output).to include 'create_view "scenic.searches",'
end
Expand Down Expand Up @@ -131,15 +133,15 @@ class SearchInAHaystack < ActiveRecord::Base
it "dumps a create_view for a view in the database" do
view_definition = "SELECT 'needle'::text AS haystack"
Search.connection.execute(
"CREATE SCHEMA scenic; SET search_path TO scenic, public"
"CREATE SCHEMA IF NOT EXISTS scenic; SET search_path TO scenic, public"
)
Search.connection.create_view 'scenic."search in a haystack"',
sql_definition: view_definition

expect(output).to include 'create_view "scenic.\"search in a haystack\"",'
expect(output).to include view_definition

Search.connection.drop_view :"scenic.\"search in a haystack\""
Search.connection.execute "DROP SCHEMA IF EXISTS scenic CASCADE;"

silence_stream($stdout) { eval(output) } # standard:disable Security/Eval

Expand Down
2 changes: 0 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
DatabaseCleaner.strategy = :transaction

config.around(:each, db: true) do |example|
ActiveRecord::SchemaMigration.create_table

DatabaseCleaner.start
example.run
DatabaseCleaner.clean
Expand Down

0 comments on commit 05aa517

Please sign in to comment.