liarsdice_cbarcroft 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  require 'rspec/mocks/standalone'
2
- require '../../liars_dice.rb'
2
+ require_relative "../../liars_dice.rb"
3
3
 
4
4
  Given /^I start a new game$/ do
5
5
  @game = LiarsDice.new
data/lib/liars_dice.rb CHANGED
@@ -9,7 +9,11 @@ class LiarsDice
9
9
  @players = {:player => "Player", :computer => "Computer"}
10
10
  @current_player = first_turn
11
11
  if first_turn == false
12
- @current_player = [:computer, :player].sample
12
+ if [:computer, :player].respond_to?(sample) then
13
+ @current_player = [:computer, :player].sample
14
+ else
15
+ @current_player = [:computer, :player].choice
16
+ end
13
17
  end
14
18
  @waiting_player = [:computer, :player].select{|player| player != @current_player}[0]
15
19
  @current_bet = {:face => 1, :count => 1}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liarsdice_cbarcroft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: