test/lib/vedeu/cursors/dsl_test.rb in vedeu-0.8.4 vs test/lib/vedeu/cursors/dsl_test.rb in vedeu-0.8.5

- old
+ new

@@ -8,10 +8,20 @@ class DSLTestClass include Vedeu::Cursors::DSL + attr_accessor :cursor_visible + + def model + self + end + + def name + :actinium + end + end # DSLTestClass describe DSL do let(:described) { Vedeu::Cursors::DSL } @@ -37,82 +47,86 @@ it { instance.must_respond_to(:hide_cursor!) } end # describe '#cursor' do # let(:_value) {} + # let(:cursor) { Vedeu::Cursors::Cursor.new(name: :actinium) } - # before { Vedeu.cursors.reset } + # before do + # Vedeu.cursors.reset! + # Vedeu.cursors.stubs(:by_name).returns(cursor) + # end # subject { instance.cursor(_value) } # it do # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(false) + # Vedeu.cursors.by_name(:actinium).visible?.must_equal(false) # end # context 'when the value is false' do # let(:_value) { false } # it do # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(false) + # Vedeu.cursors.by_name(:actinium).visible?.must_equal(false) # end # end # context 'when the value is nil' do # let(:_value) {} # it do # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(false) + # Vedeu.cursors.by_name(:actinium).visible?.must_equal(false) # end # end # context 'when the value is :show' do # let(:_value) { :show } # it do # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(true) + # Vedeu.cursors.by_name(:actinium).visible?.must_equal(true) # end # end # context 'when the value is true' do # let(:_value) { true } # it do # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(true) + # Vedeu.cursors.by_name(:actinium).visible?.must_equal(true) # end # end # context 'when the value is :yes' do # let(:_value) { :yes } # it do # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(true) + # Vedeu.cursors.by_name(:actinium).visible?.must_equal(true) # end # end # end - # describe '#cursor!' do - # subject { instance.cursor! } + describe '#cursor!' do + subject { instance.cursor! } - # it do - # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(true) - # end - # end + it do + subject + Vedeu.cursors.by_name(:actinium).visible?.must_equal(true) + end + end - # describe '#no_cursor!' do - # subject { instance.no_cursor! } + describe '#no_cursor!' do + subject { instance.no_cursor! } - # it do - # subject - # Vedeu.cursors.find('actinium').visible?.must_equal(false) - # end - # end + it do + subject + Vedeu.cursors.by_name(:actinium).visible?.must_equal(false) + end + end end # DSL end # Cursors