test/lib/vedeu/output/foreground_test.rb in vedeu-0.0.14 vs test/lib/vedeu/output/foreground_test.rb in vedeu-0.0.15
- old
+ new
@@ -4,44 +4,64 @@
describe Foreground do
let(:described_class) { Foreground }
let(:described_instance) { described_class.new(colour) }
let(:colour) {}
- it { described_instance.must_be_instance_of(Foreground) }
+ it 'returns a Foreground instance' do
+ described_instance.must_be_instance_of(Foreground)
+ end
describe '#escape_sequence' do
let(:subject) { described_instance.escape_sequence }
- it { subject.must_be_instance_of(String) }
+ it 'returns a String' do
+ subject.must_be_instance_of(String)
+ end
context 'with no colour' do
- it { subject.must_be_instance_of(String) }
+ it 'returns a String' do
+ subject.must_be_instance_of(String)
+ end
- it { subject.must_equal("\e[38;5;39m") }
+ it 'returns an escape sequence' do
+ subject.must_equal("\e[38;5;39m")
+ end
end
context 'with a named colour' do
let(:colour) { :red }
- it { subject.must_be_instance_of(String) }
+ it 'returns a String' do
+ subject.must_be_instance_of(String)
+ end
- it { subject.must_equal("\e[38;5;31m") }
+ it 'returns an escape sequence' do
+ subject.must_equal("\e[38;5;31m")
+ end
end
context 'with a html colour' do
let(:colour) { '#aadd00' }
- it { subject.must_be_instance_of(String) }
+ it 'returns a String' do
+ subject.must_be_instance_of(String)
+ end
- it { subject.must_equal("\e[38;5;148m") }
+ it 'returns an escape sequence' do
+ subject.must_equal("\e[38;5;148m")
+ end
end
context 'with a default colour' do
let(:colour) { :undefined }
- it { subject.must_be_instance_of(String) }
+ it 'returns a String' do
+ subject.must_be_instance_of(String)
+ end
- it { subject.must_equal("\e[38;5;39m") }
+ it 'returns an escape sequence' do
+ subject.must_equal("\e[38;5;39m")
+ end
end
end
end
end