Sha256: 89c124788abec581b739b20937b3148a0db233d8917b18eda7c260bf39ce1aef

Contents?: true

Size: 1.26 KB

Versions: 7

Compression:

Stored size: 1.26 KB

Contents

require 'test_helper'

module Vedeu

  describe Refresh do

    let(:described) { Vedeu::Refresh }

    before { Vedeu.interfaces.reset }

    describe '.all' do
      subject { described.all }

      it { subject.must_be_instance_of(Array) }

      context 'when there are no registered interfaces' do
        it { subject.must_equal([]) }
      end
    end

    describe '.by_focus' do
      subject { described.by_focus }

      context 'when there are no registered interfaces' do
        before { Vedeu.focusable.reset }

        it { subject.must_equal(nil) }
      end

      context 'when there are registered interfaces' do
        # @todo
        # it { skip }
      end
    end

    describe '.by_group' do
      let(:group_name) { 'elements' }
      let(:_name)      { 'aluminium' }

      subject { described.by_group(group_name) }

      it {
        Vedeu::RefreshGroup.expects(:by_name).with(group_name)
        subject
      }
    end

    describe '.by_name' do
      let(:_name)  { 'aluminium' }
      let(:buffer) { Vedeu::Null::Buffer.new(name: _name) }

      subject { described.by_name(_name) }

      it {
        Vedeu.buffers.expects(:by_name).with(_name).returns(buffer)
        buffer.expects(:render)
        subject
      }
    end

  end # Refresh

end # Vedeu

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vedeu-0.4.61 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.60 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.59 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.58 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.57 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.56 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.55 test/lib/vedeu/output/refresh_test.rb