Sha256: d86dd60ed5751cc6463d97725f80cb483ab3cf0f3eb7f1f85c2f43f7694eec93
Contents?: true
Size: 1.07 KB
Versions: 25
Compression:
Stored size: 1.07 KB
Contents
require 'spec_helper' describe Infobar::Spinner do it 'spins according to count' do spinner = described_class.new expect(spinner.spin(0).to_s).to eq ?| expect(spinner.spin(1).to_s).to eq ?/ expect(spinner.spin(2).to_s).to eq ?– expect(spinner.spin(3).to_s).to eq ?\\ expect(spinner.spin(4).to_s).to eq ?| end it 'supports different frames' do spinner = described_class.new(%w[ . o O ]) expect(spinner.spin(0).to_s).to eq ?. expect(spinner.spin(1).to_s).to eq ?o expect(spinner.spin(2).to_s).to eq ?O expect(spinner.spin(3).to_s).to eq ?. end it 'supports different predefined frames' do expect do described_class.new(:fuck_it) end.to raise_error(KeyError) spinner = described_class.new(:cross) expect(spinner.spin(0).to_s).to eq ?+ expect(spinner.spin(1).to_s).to eq ?× expect(spinner.spin(2).to_s).to eq ?+ end it 'can spin randomly' do srand 1 spinner = described_class.new(:braille7) expect(spinner.spin(:random).to_s).to eq ?⣟ expect(spinner.spin(:random).to_s).to eq ?⢿ end end
Version data entries
25 entries across 25 versions & 1 rubygems