Sha256: 3f37fccf71d28d75df4bb3a4d4112c9eb96b6a192574c9e453d3ce620f9deb1c

Contents?: true

Size: 862 Bytes

Versions: 10

Compression:

Stored size: 862 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

def behave_as_electric_musician
  respond_to(:read_notes, :turn_down_amp)
end

def behave_as_musician
  respond_to(:read_notes)
end

module BehaveAsExample
  
  class BluesGuitarist
    def read_notes; end
    def turn_down_amp; end
  end
  
  class RockGuitarist
    def read_notes; end
    def turn_down_amp; end
  end
  
  class ClassicGuitarist
    def read_notes; end
  end
  
  describe BluesGuitarist do
    it "should behave as guitarist" do
      BluesGuitarist.new.should behave_as_electric_musician
    end
  end

  describe RockGuitarist do
    it "should behave as guitarist" do
      RockGuitarist.new.should behave_as_electric_musician
    end
  end

  describe ClassicGuitarist do
    it "should not behave as guitarist" do
      ClassicGuitarist.new.should behave_as_musician
    end
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rspec-0.9.0 examples/behave_as_example.rb
rspec-0.9.1 examples/behave_as_example.rb
rspec-0.9.2 examples/behave_as_example.rb
rspec-0.9.3 examples/behave_as_example.rb
rspec-0.9.4 examples/behave_as_example.rb
rspec-1.0.0 examples/behave_as_example.rb
rspec-1.0.1 examples/behave_as_example.rb
rspec-1.0.2 examples/behave_as_example.rb
rspec-1.0.3 examples/behave_as_example.rb
rspec-1.0.4 examples/behave_as_example.rb