Displaying 1 result from an estimated 1 matches for "fighters_test".
2012 Feb 10
0
Rspec testing (gunfight at coral)
...e a ruby class called Fighters that takes in a set of cowboys and
attacks between cowboys, e.g.
Fighters.new([:a,:b,:c],[[:a,:b],[:b,:c],[:c,:a]])
This represents the situation where we have 3 cowboys :a,:b,:c and :a
aims at :b, :b aims at :c and :c aims at :a.
Write rspec tests (in a file called fighters_test.rb) for the following
methods on this class, and then implement these methods.
1. conflict_free?(cowboys) which takes in a set of cowboys and returns
true if this set is conflict-free and false otherwise.
2. defended?(cowboy,group) which returns true if the cowboy is defended
by the group and fal...