Sha256: bea7cae38d90b2dc5f6d3147795e496aca1536885b48ec03cfe285212f527cf1

Contents?: true

Size: 725 Bytes

Versions: 68

Compression:

Stored size: 725 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

class TestTimeline < Test::Unit::TestCase
  def setup
    @timeline = Timeline.new(5)
  end
  
  def test_new_should_be_empty
    assert_equal 0, @timeline.size
  end
  
  def test_should_not_grow_to_more_than_size
    (1..10).each do |i|
      @timeline.push(i)
    end
    
    assert_equal [6, 7, 8, 9, 10], @timeline
  end
  
  def test_clear_should_clear_array
    @timeline << 1
    assert_equal [1], @timeline
    assert_equal [], @timeline.clear
  end
  
  # def test_benchmark
  #   require 'benchmark'
  # 
  #   count = 1_000_000
  # 
  #   t = Timeline.new(10)
  # 
  #   Benchmark.bmbm do |x|
  #     x.report("go") { count.times { t.push(5) } }
  #   end
  # end
end

Version data entries

68 entries across 68 versions & 22 rubygems

Version Path
dguettler-god-0.7.13.2 test/test_timeline.rb
dguettler-god-0.7.13.3 test/test_timeline.rb
dosire-god-0.7.10 test/test_timeline.rb
dosire-god-0.7.12 test/test_timeline.rb
dosire-god-0.7.9 test/test_timeline.rb
dunedain289-god-0.7.12.1 test/test_timeline.rb
dustin-god-0.7.7.1 test/test_timeline.rb
eric-god-0.7.10 test/test_timeline.rb
eric-god-0.7.11 test/test_timeline.rb
eric-god-0.7.12 test/test_timeline.rb
eric-god-0.7.14 test/test_timeline.rb
eric-god-0.7.7 test/test_timeline.rb
fotonauts-god-0.7.10 test/test_timeline.rb
fotonauts-god-0.7.12 test/test_timeline.rb
gohanlonllc-god-0.7.9 test/test_timeline.rb
gordoncww-god-0.7.11.1 test/test_timeline.rb
jreynolds-god-0.7.13 test/test_timeline.rb
jwilkins-god-0.7.9 test/test_timeline.rb
mathieuravaux-god-0.7.11 test/test_timeline.rb
mojombo-god-0.7.10 test/test_timeline.rb