Skip to content
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
7 changes: 6 additions & 1 deletion lib/interscript/stdlib/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ def self.secryst(output, model:)
SecrystAdapter.call(output, model: model)
end

def self.rababa(output, config:)
# A bare `rababa` directive (no config:) is a map-logic error — the
# grammar's kwargs are optional, and a Ruby ArgumentError here is
# accidental (WO18 G11; ts/py raise their named errors, rs rejects
# at load).
def self.rababa(output, config: nil)
raise Interscript::MapLogicError, "rababa requires config:" unless config
RababaAdapter.call(output, config: config)
end

Expand Down
13 changes: 13 additions & 0 deletions spec/stdlib_functions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,16 @@
end
end
end

RSpec.describe Interscript::Stdlib::Functions do
# WO18 G11 (parity audit): a bare `rababa` directive (no config:) is a
# map-logic error, not a Ruby ArgumentError — ts/py raise their named
# provisioning errors, rs rejects at load; ruby must fail named too.
describe ".rababa without config" do
it "raises MapLogicError, not ArgumentError" do
expect { described_class.rababa("مرحبا") }.to raise_error(
Interscript::MapLogicError, /rababa requires config/
)
end
end
end
Loading