Sha256: e04d13714a8d109da9e186618fa9d8ab18f413ab4ff9edbbfe2f97e021a4a0be

Contents?: true

Size: 776 Bytes

Versions: 43

Compression:

Stored size: 776 Bytes

Contents

#!/usr/bin/env ruby

$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))

require 'test/unit'
require 'rex/ui'

class Rex::Ui::Text::ProgressTracker::UnitTest < Test::Unit::TestCase

	def test_stuff
		output   = Rex::Ui::Text::Output::Buffer.new
		pt       = Rex::Ui::Text::ProgressTracker.new(output)

		pt.range = 1..10
	
		assert_equal(1, pt.start)
		assert_equal(10, pt.stop)

		pt.start = 2
		assert_equal(2, pt.start)
		pt.stop = 9
		assert_equal(9, pt.stop)
		assert_equal(2, pt.pos)
		assert_equal('', output.buf)
		assert_equal(3, pt.step)
		assert_equal(4, pt.step("test"))
		assert_equal("[*] 4: test\n", output.buf)
		output.reset
		assert_equal("[-] bad\n", pt.error("bad"))
		output.reset
		assert_equal("[-] fatal: bad\n", pt.abort("bad"))
	end

end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
librex-0.0.65 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.63 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.54 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.53 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.52 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.51 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.50 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.49 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.48 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.47 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.46 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.44 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.43 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.42 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.41 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.40 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.39 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.38 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.37 lib/rex/ui/text/progress_tracker.rb.ut.rb
librex-0.0.36 lib/rex/ui/text/progress_tracker.rb.ut.rb