Skip to content

Commit

Permalink
test: update specs; fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ocvit committed Mar 12, 2024
1 parent 8cf3595 commit 104f693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions spec/contr/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
expect(contract.main_pool).to be_fixed_async_pool
expect(contract.rules_pool).to be_nil
expect(contract.name).to eq "ContractWithoutRules"
expect(contract.frozen?).to eq true
end
end

Expand Down Expand Up @@ -279,7 +280,7 @@
subject(:result) { contract.check_async(*args) { operation.call } }

context "with async rules" do
context "using default pool" do
context "using fixed pool" do
before do
define_contract_class("BaseContract", PreConfiguredContract) do
async pools: {rules: Contr::Async::Pool::Fixed.new}
Expand All @@ -293,13 +294,10 @@
it_behaves_like "contract failed in async check with async rules"
end

context "using global pools" do
context "using global pool" do
before do
define_contract_class("BaseContract", PreConfiguredContract) do
async pools: {
main: Contr::Async::Pool::Fixed.new,
rules: Contr::Async::Pool::GlobalIO.new
}
async pools: {rules: Contr::Async::Pool::GlobalIO.new}
end

run_async_matcher_inline!
Expand Down
2 changes: 1 addition & 1 deletion spec/support/class_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def define_class(class_name, superclass, &block)
stub_const(class_name, klass)
end

def define_contract_class(contract_name, superclass = described_class, &block)
def define_contract_class(contract_name, superclass = Contr::Base, &block)
define_class(contract_name, superclass, &block)
end
end

0 comments on commit 104f693

Please sign in to comment.