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
typo-5.0.3.98.1 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.0.3.98 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.0 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.1.1 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.1.2 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.1.3 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.1 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.1.98 vendor/plugins/rspec/examples/pure/behave_as_example.rb
typo-5.2 vendor/plugins/rspec/examples/pure/behave_as_example.rb