Skip to content

Commit

Permalink
Update to Ruby 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
svoop committed Jan 12, 2024
1 parent fb64379 commit 56f67eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
ruby: ['3.0', '3.1', '3.2']
ruby: ['3.0', '3.1', '3.2', '3.3']
name: test (Ruby ${{ matrix.ruby }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2
3.3
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#### Changes
* Adhere to plugin file layout suggestions
* Support Ruby 3.3

## 0.4.3

Expand Down
32 changes: 12 additions & 20 deletions spec/lib/rodbot/plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,22 @@ def run(*)

describe :extensions do
describe :extend_app do
it "requires the corresponding app.rb file" do
subject.extend_app
it "requires the corresponding app.rb file, registers routes and plugins" do
$checkpoints = []
App.stub(:run,
-> { $checkpoints << :added if _1 == :hal && _2 == Rodbot::Plugins::Hal::App::Routes }
) do
Roda::RodaPlugins.stub(:register_plugin,
-> { $checkpoints << :registered if _1 == :hal && _2 == Rodbot::Plugins::Hal::App }
) do
subject.extend_app
end
end
_(subject.extensions[:app]).must_equal(
hal: 'rodbot/plugins/hal/app',
otp: 'rodbot/plugins/otp/app'
)
end

it "registers App routes" do
subject.instance_variable_set(:@extensions, {})
App.stub(:run,
-> { throw :added if _1 == :hal && _2 == Rodbot::Plugins::Hal::App::Routes }
) do
_{ subject.extend_app }.must_throw :added
end
end

it "registers Roda plugins" do
subject.instance_variable_set(:@extensions, {})
Roda::RodaPlugins.stub(:register_plugin,
-> { throw :registered if _1 == :hal && _2 == Rodbot::Plugins::Hal::App }
) do
_{ subject.extend_app }.must_throw :registered
end
_($checkpoints).must_equal %i(added registered)
end
end

Expand Down

0 comments on commit 56f67eb

Please sign in to comment.