changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/examples/pure/behave_as_example.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/spec_helper'
2
3def behave_as_electric_musician
4 respond_to(:read_notes, :turn_down_amp)
5end
6
7def behave_as_musician
8 respond_to(:read_notes)
9end
10
11module BehaveAsExample
12
13 class BluesGuitarist
14 def read_notes; end
15 def turn_down_amp; end
16 end
17
18 class RockGuitarist
19 def read_notes; end
20 def turn_down_amp; end
21 end
22
23 class ClassicGuitarist
24 def read_notes; end
25 end
26
27 describe BluesGuitarist do
28 it "should behave as guitarist" do
29 BluesGuitarist.new.should behave_as_electric_musician
30 end
31 end
32
33 describe RockGuitarist do
34 it "should behave as guitarist" do
35 RockGuitarist.new.should behave_as_electric_musician
36 end
37 end
38
39 describe ClassicGuitarist do
40 it "should not behave as guitarist" do
41 ClassicGuitarist.new.should behave_as_musician
42 end
43 end
44
45end