Skip to content

Commit

Permalink
Revert random running specs; up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
killondark committed Jan 8, 2025
1 parent 99dc00e commit 326c86d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!

config.order = :random

config.expect_with :rspec do |c|
c.syntax = :expect
end
Expand Down
52 changes: 25 additions & 27 deletions spec/yabeda/counter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,31 @@
Yabeda.register_adapter(:basket_adapter, basket_adapter)
end

it "raises an error using include_group construction without adapter_names args" do
expect do
Yabeda.configure do
group :mushrooms do
counter :champignon_counter
end

adapter { include_group :mushrooms }
end
Yabeda.configure! unless Yabeda.already_configured?
end.to raise_error(Yabeda::ConfigurationError, "Adapter limitation can't be defined without adapter_names")
end

it "raises an error using adapter construction into the group block without adapter_names args" do
expect do
Yabeda.configure do
group :mushrooms do
adapter
counter :champignon_counter
end
end
Yabeda.configure! unless Yabeda.already_configured?
end.to raise_error(Yabeda::ConfigurationError, "Adapter limitation can't be defined without adapter_names")
end

context "when call .adapter method in outside of group" do
before do
Yabeda.configure do
Expand All @@ -83,33 +108,6 @@
end
end

context "when call .adapter_names without adapter_names args" do
it "raises an error using include_group construction" do
expect do
Yabeda.configure do
group :mushrooms do
counter :champignon_counter
end

adapter { include_group :mushrooms }
end
Yabeda.configure! unless Yabeda.already_configured?
end.to raise_error(Yabeda::ConfigurationError, "Adapter limitation can't be defined without adapter_names")
end

it "raises an error using adapter construction into the group block" do
expect do
Yabeda.configure do
group :mushrooms do
adapter
counter :champignon_counter
end
end
Yabeda.configure! unless Yabeda.already_configured?
end.to raise_error(Yabeda::ConfigurationError, "Adapter limitation can't be defined without adapter_names")
end
end

context "when call adapter method in inside of group" do
before do
Yabeda.configure do
Expand Down
2 changes: 2 additions & 0 deletions spec/yabeda_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

RSpec.describe Yabeda do
before { described_class.reset! }

it "has a version number" do
expect(Yabeda::VERSION).not_to be_nil
end
Expand Down

0 comments on commit 326c86d

Please sign in to comment.