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

Update supported ruby and rails versions #3

Merged
merged 1 commit into from
Jan 7, 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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.2', '3.1', '2.7']
rails: ['7.0']
ruby: ['3.3', '3.2', '3.1']
rails: ['7.0', '7.1']

runs-on: 'ubuntu-latest'
env:
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ gemspec name: "humid", path: "../"
gem "rake"
gem "rspec"
gem "byebug"
gem 'rails', '~> 7.0'
gem 'rails', '~> 7.0.0'
8 changes: 8 additions & 0 deletions gemfiles/rails7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gemspec name: "humid", path: "../"

gem "rake"
gem "rspec"
gem "byebug"
gem 'rails', '~> 7.1.0'
11 changes: 8 additions & 3 deletions spec/log_subscriber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@ def current
Thread.current.active_support_execution_state
end

def key
if Rails.version >= "7.1"
"attr_humid_runtime_#{Humid::LogSubscriber.object_id}"
else
"attr_Humid::LogSubscriber_humid_runtime"
end
end

context ".runtime" do
it "is returns the runtime from the thread local" do
expect(Humid::LogSubscriber.runtime).to eql 0
key = "attr_Humid::LogSubscriber_humid_runtime"
current[key] = 3
expect(Humid::LogSubscriber.runtime).to eql 3
end
Expand All @@ -30,15 +37,13 @@ def current
it "sets the runtime in a thread-safe manner" do
expect(Humid::LogSubscriber.runtime).to eql 0
Humid::LogSubscriber.runtime = 3
key = "attr_Humid::LogSubscriber_humid_runtime"
expect(current[key]).to eql 3
end
end

context ".reset_runtime" do
it "resets the runtime" do
Humid::LogSubscriber.runtime = 3
key = "attr_Humid::LogSubscriber_humid_runtime"
expect(current[key]).to eql 3

Humid::LogSubscriber.reset_runtime
Expand Down