Sha256: ffaf1ac2d2b0af50bbcb9b84d8a446e2bc422d5a19532b3ec97d6feb7e431f4f

Contents?: true

Size: 863 Bytes

Versions: 89

Compression:

Stored size: 863 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

89 entries across 89 versions & 13 rubygems

Version Path
picolena-0.1.3 rails_plugins/rspec/examples/pure/behave_as_example.rb
picolena-0.1.4 rails_plugins/rspec/examples/pure/behave_as_example.rb
picolena-0.1.5 rails_plugins/rspec/examples/pure/behave_as_example.rb
pictrails-0.5.0 vendor/plugins/rspec/examples/pure/behave_as_example.rb
radiant-0.6.5.1 vendor/plugins/rspec/examples/pure/behave_as_example.rb
radiant-0.6.5 vendor/plugins/rspec/examples/pure/behave_as_example.rb
radiant-0.6.6 vendor/plugins/rspec/examples/pure/behave_as_example.rb
radiant-0.6.7 vendor/plugins/rspec/examples/pure/behave_as_example.rb
radiant-0.6.9 vendor/plugins/rspec/examples/pure/behave_as_example.rb
radiant-0.6.8 vendor/plugins/rspec/examples/pure/behave_as_example.rb
rspec-0.0.10 examples/pure/behave_as_example.rb
rspec-1.0.5 examples/behave_as_example.rb
rspec-1.0.7 examples/behave_as_example.rb
rspec-1.1.1 examples/pure/behave_as_example.rb
rspec-1.1.10 examples/pure/behave_as_example.rb
rspec-1.0.8 examples/behave_as_example.rb
rspec-1.0.6 examples/behave_as_example.rb
rspec-1.1.0 examples/pure/behave_as_example.rb
rspec-1.1.3 examples/pure/behave_as_example.rb
rspec-1.1.2 examples/pure/behave_as_example.rb