Sha256: f18e36d930f5356c23e257d8f076c7e109c1794652f1fed5f6248f1065854266
Contents?: true
Size: 1.33 KB
Versions: 14
Compression:
Stored size: 1.33 KB
Contents
require 'minitest/autorun' require "#{File.expand_path(File.dirname(__FILE__))}/../lib/traquitana.rb" describe Traquitana::Bar do before do @bar = Traquitana::Bar.new @bar.total = 100 end describe 'limits' do it 'should have a total' do expect(@bar).must_respond_to :total end it 'should have a current value' do expect(@bar).must_respond_to :current end end describe 'updates' do it 'should have a name' do expect(@bar).must_respond_to :name end it 'should have a update method' do expect(@bar).must_respond_to :update end it 'should have a indicator method' do expect(@bar).must_respond_to :indicator end it 'should return the correct string for 0%' do expect(@bar.indicator(0)).must_equal '____________________' end it 'should return the correct string for 25%' do expect(@bar.indicator(25)).must_equal '#####_______________' end it 'should return the correct string for 50%' do expect(@bar.indicator(50)).must_equal '##########__________' end it 'should return the correct string for 75%' do expect(@bar.indicator(75)).must_equal '###############_____' end it 'should return the correct string for 100%' do expect(@bar.indicator(100)).must_equal '####################' end end end
Version data entries
14 entries across 14 versions & 1 rubygems