RubyPulse Episode 0.28 - butterfly_net

IRB and Rails console history captured as Test::Unit tests. - quartzmo

irb:01> require 'rubygems'
=> true
irb:02> require 'butterfly_net'
=> true
irb:03> bn 'irb_tests'
=> true
irb:04> a = 1
=> 1
irb:05> a += 4
=> 5
irb:06> a == 5
=> true
irb:07> m 'plusequals'
=> true
irb:08> require 'bigdecimal'
=> true
irb:09> infinity = BigDecimal('Infinity')
=> #
irb:10> BigDecimal.new("1.0") / BigDecimal.new("0.0") == infinity
=> true
irb:11> m 'bigdecimal_infinity'
=> true
irb:12> exit
butterfly_net: irb_tests.rb was not created. No tests were generated from this session.
butterfly_net: irb_tests.rb was not created. No tests were generated from this session.
butterfly_net: irb_tests.rb was not created. No tests were generated from this session.
butterfly_net: First invoke 'bn' or 'bn_open' to begin a session
butterfly_net: First invoke 'bn' or 'bn_open' to begin a session
butterfly_net: First invoke 'bn' or 'bn_open' to begin a session
butterfly_net: First invoke 'bn' or 'bn_open' to begin a session
butterfly_net: irb_tests.rb created.
true
butterfly_net: irb_tests.rb was not created. No tests were generated from this session.
false

rubypulse ~ ls
dir/  irb_tests.rb  playground/

rubypulse ~ cat irb_tests.rb 
require "test/unit"

# IRB test capture courtesy of butterfly_net (butterflynet.org)
class MyTest < Test::Unit::TestCase

  def test_plusequals
    assert(bn 'irb_tests')
    a = 1
    assert_equal(5, a += 4)
  end

  def test_bigdecimal_infinity
    assert_equal(false, m 'plusequals')
    require 'bigdecimal'
    infinity = BigDecimal('Infinity')
  end

end


Links for this episode

HomePage of butterfly_net

Tags : butterfly_net

Download (9.3 MB, 3:08)
Alternative download for iPod and iPhone (5.3 MB, 3:08)
Powered by Olark