mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 01:30:12 +01:00
Added Rspec and Webrat plugins and started porting Selenium on Rails tests to Rspec Plain Text Stories driving Webrat driving Selenium.
This commit is contained in:
parent
0600756bbf
commit
0f7d6f7a1d
602 changed files with 47788 additions and 29 deletions
45
vendor/plugins/rspec/examples/pure/behave_as_example.rb
vendored
Executable file
45
vendor/plugins/rspec/examples/pure/behave_as_example.rb
vendored
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue