test/lib/vedeu/dsl/shared/colour_test.rb in vedeu-0.4.2 vs test/lib/vedeu/dsl/shared/colour_test.rb in vedeu-0.4.3
- old
+ new
@@ -5,29 +5,32 @@
module DSL
describe Colour do
let(:described) { Vedeu::DSL::Colour }
-
let(:dsl_klass) { Vedeu::DSL::Interface.new(model) }
let(:model) { Vedeu::Interface.new }
let(:background) { '#00ff00' }
let(:foreground) { '#ff00ff' }
+ describe 'alias methods' do
+ it { dsl_klass.must_respond_to(:bg) }
+ it { dsl_klass.must_respond_to(:bgcolor) }
+ it { dsl_klass.must_respond_to(:fg) }
+ it { dsl_klass.must_respond_to(:fgcolor) }
+ end
+
describe '#background' do
subject { dsl_klass.background(background) }
it { subject.must_be_instance_of(Vedeu::Colour) }
it 'sets the background' do
subject.attributes.must_equal(
{ background: '#00ff00', foreground: '' }
)
end
-
- it { dsl_klass.must_respond_to(:bg) }
- it { dsl_klass.must_respond_to(:bgcolor) }
end
describe '#foreground' do
subject { dsl_klass.foreground(foreground) }
@@ -36,12 +39,9 @@
it 'sets the foreground' do
subject.attributes.must_equal(
{ background: '', foreground: '#ff00ff' }
)
end
-
- it { dsl_klass.must_respond_to(:fg) }
- it { dsl_klass.must_respond_to(:fgcolor) }
end
describe '#colour' do
let(:attributes) { { background: background, foreground: foreground } }