Inhaltsverzeichnis
Ruby / Ruby on Rails Certification
Idee
Ruby / Ruby on Rails Zertfizierung für Entwickler.
Vorteile
- Grössere Akzeptanz von R / RoR - Entwickler bei Firmen
- RoR User Group ist das Kompetenzzentrum für R / RoR
- Bessere Chancen auf dem Arbeitsmarkt für R / RoR Entwickler
Konzept
- Die RoR User Group konstituiert sich als gemeinnütziger Verein
- Klare Strukturen
- Absicherung gegen finanzielle Forderungen
- Mitglieder sind klar (Nur Firmenmitglieder zahlen)
- Die R / RoR Exam wird „The Rails Way“ gestaltet
- Community wird einbezogen in die Erarbeitung der Fragen
- Fragen sind grundsätzlich ein Test der „Failed“ und zum laufen gebracht werden muss
- Open Book (bzw. Open Laptop) Konzept; d.h. jeder darf seinen eigenen Laptop ans Exam mitbringen
- Das Ruby Exam ist Teil des Ruby on Rails Exams, kann aber separat getestet werden
Umsetzung
- Gemeinnütziger Verein gründen
- Statuten
- Exam erstellen
- Ausschreibung „Einreichen von Prüfungsfragen“
- Selektion der Fragen
- Erstellen des Exams
- Durchführen
Beispiel Prüfungsfrage
Wie muss dieser Code angepasst werden, damit er die nachfolgenden Tests besteht?
countdown.rb:
class Countdown < Array
@current_index = nil
def initialize(size = 10)
[0..size-1].each{|x| self << x}
end
def start(start_index = self.size )
@current_index = start_index
end
def step
raise Exception.new("Take off!") if @current_index == 0
@current_index =- 1
end
def current_state
self[@current_index]
end
end
countdown_spec.rb
describe "Countdown" do
before(:each) do
@size = 10
@cd = Countdown.new(@size)
end
describe "initialize" do
it "should initialize the object to the given size" do
@cd.size.should == 10
end
end
describe "start" do
it "should start the countdown with the last element" do
@cd.start
@cd.current_state.should == @cd.last
end
it "should start the countdown with the index given" do
@cd.start(2)
@cd.current_state.should == 2
end
describe "step down without start" do
it "should fail with an exception 'Not yet started' if zero the countdown is not started yet" do
lambda {@cd.step}.should raise_error('Countdown not yet started')
end
end
end
describe "step down after start" do
before(:each) do
@cd.start
end
it "should step down one with every step (until zero is reached)" do
old_state = @cd.current_state
@cd.step
new_state = @cd.current_state
(old_state - 1).should == new_state
end
it "should fail with an exception 'Take off!' if zero is reached" do
@cd.stub!(:current_state).and_return(0)
lambda {@cd.step}.should raise_error('Take off!')
end
it "should raise the Take off Exception in the end" do
@cd.start
lambda {
12.times{@cd.step}
}.should raise_error('Take off!')
end
end
end

