Displaying 1 result from an estimated 1 matches for "andrew_wc_brown".
2008 Jan 30
9
catching errors, rspec basics
...TypeError in ''Audience.stats should return an error when passed a string''
String can''t be coerced into Fixnum
./audience.rb:11:in `*''
./audience.rb:11:in `stats=''
./audience_spec.rb:29:
Finished in 0.006333 seconds
2 examples, 1 failure
monsterbox:spec andrew_wc_brown$
class Audience
  attr_accessor :stats
  def initialize(name = nil,value = nil)
    @name ||= ''all''
    @value ||= value
  end
  def stats=(flux)
    @stats = @value * flux / 0.025
  end
  def market_share
    "The Market share is for #{@name} at a high of #{@stats}&qu...