spec/fontlike_spec.rb in fontlike-0.0.2 vs spec/fontlike_spec.rb in fontlike-0.0.3
- old
+ new
@@ -1,50 +1,59 @@
require 'fontlike'
+require 'unicode_utils'
INPUT = "What do you think, mr fancy pants?"
describe Fontlike::Transmuter do
let(:transmuter) { Fontlike::Transmuter.new(opts) }
let(:opts) { {} }
let(:output) { transmuter.transmute(INPUT) }
describe 'with fancy flag' do
- let(:opts) { { fancy: true } }
+ let(:opts) { { style: :fancy } }
it 'outputs some fancy text' do
expect(output).to eq("π¦π±πͺπ½ ππΈ ππΈπΎ π½π±π²π·π΄, πΆπ» π―πͺπ·π¬π πΉπͺπ·π½πΌ?")
end
end
describe 'with shout flag' do
- let(:opts) { { shout: true } }
+ let(:opts) { { style: :shout } }
it 'outputs some shout text' do
expect(output).to eq("WHAT DO YOU THINK, MR FANCY PANTS?")
end
end
describe 'with mono flag' do
- let(:opts) { { mono: true } }
+ let(:opts) { { style: :mono } }
it 'outputs some mono text' do
expect(output).to eq("ππππ ππ π’ππ πππππ, ππ πππππ’ πππππ?")
end
end
describe 'with sans_serif flag' do
- let(:opts) { { sans_serif: true } }
+ let(:opts) { { style: :sans_serif } }
it 'outputs some sans_serif text' do
expect(output).to eq("πΆππΊπ π½π πππ πππππ, ππ πΏπΊππΌπ ππΊπππ?")
end
end
describe 'with double_struck flag' do
- let(:opts) { { double_struck: true } }
+ let(:opts) { { style: :double_struck } }
it 'outputs some double_struck text' do
expect(output).to eq("ππππ₯ ππ πͺπ π¦ π₯ππππ, ππ£ πππππͺ π‘πππ₯π€?")
+ end
+ end
+
+ describe 'with random flag' do
+ let(:opts) { { style: :random } }
+
+ it 'outputs some random text' do
+ expect(UnicodeUtils.display_width(output)).to eq(UnicodeUtils.display_width(INPUT))
end
end
describe 'with no flag' do
it 'outputs some double_struck text' do