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
dchelimsky-rspec-1.1.10 examples/pure/behave_as_example.rb
dchelimsky-rspec-1.1.11.1 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.11.2 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.11.3 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.11.4 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.11.5 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.11.6 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.11.7 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.11 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.12 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.1 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.13 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.2 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.3 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.4 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.5 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.6 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.7 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.8 examples/passing/behave_as_example.rb
dchelimsky-rspec-1.1.99.9 examples/passing/behave_as_example.rb