Skip to content

Commit

Permalink
fixup! add in AR 6.1 and 7.0 support, also Ruby 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
urkle committed May 12, 2022
1 parent e5ee250 commit a92caae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions spec/enum_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def enum_fields(name, schema = 'public')
migration.execute 'DROP TYPE IF EXISTS color'
end

context 'when postgresql version is >= 10', pg_version: '>= 10.0' do
context 'when postgresql version is >= 10', postgresql: '>= 10.0' do
it 'renames the value' do
expect {
migration.rename_enum_value('color', 'green', 'orange')
Expand All @@ -257,7 +257,7 @@ def enum_fields(name, schema = 'public')
end
end

context 'when postgresql version is < 10', pg_version: '< 10.0' do
context 'when postgresql version is < 10', postgresql: '< 10.0' do
it 'raises an error' do
expect {
migration.rename_enum_value('color', 'green', 'orange')
Expand Down
7 changes: 0 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@
RSpec.configure do |config|
config.warnings = true

config.filter_run_excluding pg_version: lambda { |v|
version = ActiveRecord::Base.connection.select_value("SHOW server_version").match(/(\d+\.\d+)/)[1]
postgresql_version = Gem::Version.new(version)
test = Gem::Requirement.new(v)
!test.satisfied_by?(postgresql_version)
}

config.after do
ActiveRecord::Base.connection.tap do |c|
c.enums.each do |p, e, _|
Expand Down

0 comments on commit a92caae

Please sign in to comment.