Sha256: 961c1c3e31506d9ce62e32535460fed97afabdcb396d35b57aea76b454c3d453

Contents?: true

Size: 631 Bytes

Versions: 3

Compression:

Stored size: 631 Bytes

Contents

require 'spec'

shared_examples_for 'a clean test' do
  before{ Peeping::Peep.clear_all_hooks! }
  after { Peeping::Peep.clear_all_hooks! }
end

#--
# Dummy class, used for testing
class Dog

  attr_accessor :name, :trained, :owner
  attr_accessor :a, :b

  def initialize(name)
    @name = name
  end

  def bark(times)
    (["woof"] * times).join(' ') + "!"
  end

  def lick_owner
    if @owner
      "#{@owner} is now all wet!"
    else
      "I have no owner to lick :("
    end
  end

  def self.train(dog)
    dog.trained = true
    dog
  end

  def self.eats?(thing)
    %w{meat bones milk}.include?(thing)
  end

end
#++

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chubas-peeping-1.0.0 spec/helpers/test_helpers.rb
chubas-peeping-1.1.0 spec/helpers/test_helpers.rb
chubas-peeping-1.1.1 spec/helpers/test_helpers.rb