File tree Expand file tree Collapse file tree 4 files changed +7
-18
lines changed
Expand file tree Collapse file tree 4 files changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ def self.attach_function(ctx)
2727 ctx . eval <<~JS
2828 function roll(...diceRolls) {
2929 const roller = new rpgDiceRoller.DiceRoller;
30- const rolls = roller.roll(...diceRolls);
31- return rolls
30+ roller.roll(...diceRolls);
31+ return JSON.parse(JSON.stringify(roller.log))
3232 }
3333 JS
3434 end
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ const { DiceRoller } = require("@dice-roller/rpg-dice-roller");
1111
1212function roll ( ...diceRolls ) {
1313 const roller = new DiceRoller ( ) ;
14- const rolls = roller . roll ( ...diceRolls ) ;
15- return rolls ;
14+ roller . roll ( ...diceRolls ) ;
15+ return roller . log ;
1616}
1717
1818const r = repl . start ( { prompt : "> " } ) ;
Original file line number Diff line number Diff line change 99 result = described_class . roll ( *dice_rolls )
1010
1111 expect ( result ) . not_to be_nil
12- expect ( result ) . to be_a ( String ) # Assuming the result is serialized as a string
12+ expect ( result ) . to be_a ( Hash ) # Assuming the result is serialized as a string
1313 end
1414 end
1515
5959 end
6060
6161 xdescribe ".attach_function" do
62- xit "attaches the rollmaster_roll function to the context" do
62+ xit "attaches the roll function to the context" do
6363 context = MiniRacer ::Context . new
6464 described_class . attach_function ( context )
6565
66- result = context . eval ( "typeof rollmaster_roll " )
66+ result = context . eval ( "typeof roll " )
6767 expect ( result ) . to eq ( "function" )
6868 end
6969 end
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments