Skip to content

Commit

Permalink
Merge pull request #697 from petergoldstein/feature/add_ruby_3_2_to_ci
Browse files Browse the repository at this point in the history
Add Ruby 3.2 to the CI matrix
  • Loading branch information
etagwerker authored Jan 26, 2023
2 parents c57ab08 + b1434d2 commit 0ff5d01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
strategy:
matrix:
ruby-version:
- '3.2'
- '3.1'
- '3.0'
- '2.7'
Expand All @@ -27,7 +28,7 @@ jobs:
- 6379:6379

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
Expand Down
3 changes: 1 addition & 2 deletions lib/database_cleaner/safeguard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ def given?

def remote?(url)
return false unless url

parsed = URI.parse(url)
return false if parsed.scheme == 'sqlite3:'

host = parsed.host
return false unless host
return false if host.nil? || host.empty?
return false if LOCAL.include?(host)
return false if host.end_with? '.local'
true
Expand Down
6 changes: 3 additions & 3 deletions spec/database_cleaner/cleaner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module DatabaseCleaner
end

it "should pass all arguments to strategy initializer" do
expect(strategy_class).to receive(:new).with(:dollar, :amet, ipsum: "random").and_return(strategy)
expect(strategy_class).to receive(:new).with(:dollar, :amet, { ipsum: "random" }).and_return(strategy)
expect(strategy).to receive(:clean)
cleaner.clean_with :truncation, :dollar, :amet, ipsum: "random"
end
Expand Down Expand Up @@ -145,12 +145,12 @@ module DatabaseCleaner
end

it "should proxy params with symbolised strategies in an array" do
expect(strategy_class).to receive(:new).with(param: "one")
expect(strategy_class).to receive(:new).with({ param: "one" })
cleaner.strategy = [:truncation, param: "one"]
end

it "should proxy params with symbolised strategies in a separate hash" do
expect(strategy_class).to receive(:new).with(param: "one")
expect(strategy_class).to receive(:new).with({ param: "one" })
cleaner.strategy = :truncation, { param: "one" }
end

Expand Down

0 comments on commit 0ff5d01

Please sign in to comment.