Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Do we need any more test frameworks?

lazyatom
February 07, 2011

Do we need any more test frameworks?

A talk I gave at LRUG in 2011, about the plethora of testing frameworks in Ruby, and the urge to write my own

lazyatom

February 07, 2011
Tweet

More Decks by lazyatom

Other Decks in Programming

Transcript

  1. blah = Hubris.new do before do @x = 1 end

    it “works” do raise unless 1 == @x end after do @x = nil end end blah.run
  2. class Hubris def initialize(&block) instance_eval(&block) end def before(&block) @before =

    block end def it(name, &block) @test = block end # etc ... def run instance_eval(&@before) instance_eval(&@test) instance_eval(&@after) end end stash evaluate evaluate
  3. before / setup test ... should ... it ... after

    / teardown @f = File.new @f.unlink @f.read
  4. Hubris.new do def some_method @x = 1 end it “works”

    do raise unless 1 == some_method end end where does this method live?