spec/fixed_odds_spec.rb in rodders-3.0.1 vs spec/fixed_odds_spec.rb in rodders-3.1.0

- old
+ new

@@ -14,17 +14,17 @@ end it "does not change the input string with 'against'" do value = '4/1 against' FixedOdds.fractional_odds(value) - value.end_with?('against').should == true + value.end_with?('against').should be end it "does not modify the input string with 'on'" do value = '4/1 on' FixedOdds.fractional_odds(value) - value.end_with?('on').should == true + value.end_with?('on').should be end specify { FixedOdds.fractional_odds('4/1 against').should == FixedOdds.fractional_odds('4/1') } specify { FixedOdds.fractional_odds('4/1 on').should == FixedOdds.fractional_odds('1/4') } specify { FixedOdds.fractional_odds('evens').should == FixedOdds.fractional_odds('1/1') } @@ -78,16 +78,16 @@ RuntimeError, /could not parse "-100.1" as moneyline odds/ ) end - specify { FixedOdds.moneyline_odds('+400').profit_on_stake(Money.parse '£100').should == Money.parse('£400') } - specify { FixedOdds.moneyline_odds('+100').profit_on_stake(Money.parse '£100').should == Money.parse('£100') } + specify { FixedOdds.moneyline_odds('+400').profit_on_stake('£100'.to_money).should == '£400'.to_money } + specify { FixedOdds.moneyline_odds('+100').profit_on_stake('£100'.to_money).should == '£100'.to_money } - specify { FixedOdds.moneyline_odds('-400').profit_on_stake(Money.parse '£400').should == Money.parse('£100') } - specify { FixedOdds.moneyline_odds('-100').profit_on_stake(Money.parse '£100').should == Money.parse('£100') } - specify { FixedOdds.moneyline_odds('+100').profit_on_stake(Money.parse '£100').should == Money.parse('£100') } + specify { FixedOdds.moneyline_odds('-400').profit_on_stake('£400'.to_money).should == '£100'.to_money } + specify { FixedOdds.moneyline_odds('-100').profit_on_stake('£100'.to_money).should == '£100'.to_money } + specify { FixedOdds.moneyline_odds('+100').profit_on_stake('£100'.to_money).should == '£100'.to_money } end describe ".decimal_odds" do it "raises error if not decimal odds" do expect { @@ -96,12 +96,12 @@ RuntimeError, /could not parse "-400" as decimal odds/ ) end - specify { FixedOdds.decimal_odds('2').profit_on_stake(Money.parse '£1').should == Money.parse('£1') } - specify { FixedOdds.decimal_odds('5').profit_on_stake(Money.parse '£1').should == Money.parse('£4') } - specify { FixedOdds.decimal_odds('1.25').profit_on_stake(Money.parse '£4').should == Money.parse('£1') } + specify { FixedOdds.decimal_odds('2').profit_on_stake('£1'.to_money).should == '£1'.to_money } + specify { FixedOdds.decimal_odds('5').profit_on_stake('£1'.to_money).should == '£4'.to_money } + specify { FixedOdds.decimal_odds('1.25').profit_on_stake('£4'.to_money).should == '£1'.to_money } end describe ".from_s" do describe "bad input" do it "rejects garbage" do \ No newline at end of file