Sha256: b0e064b40351b35ffe63f83745872984dc42f19b9253a383b7f11d3415363cfe

Contents?: true

Size: 1.67 KB

Versions: 18

Compression:

Stored size: 1.67 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
      end
    end

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

      subject { described.by_group(group_name) }

      context 'when there are no registered groups' do
        let(:group_name) { '' }

        before { Vedeu.groups.reset }

        it { proc { subject }.must_raise(ModelNotFound) }
      end

      context 'when there are registered groups' do
        let(:group_name) { 'elements' }

        before do
          Vedeu::Group.new(name: group_name, members: _name).store
        end

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

    describe '.by_name' do
      let(:_name)  { 'aluminium' }
      let(:buffer) { Vedeu::Null::Buffer.new(_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

18 entries across 18 versions & 1 rubygems

Version Path
vedeu-0.4.35 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.34 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.33 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.32 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.31 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.30 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.29 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.28 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.27 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.26 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.25 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.24 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.23 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.22 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.21 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.20 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.19 test/lib/vedeu/output/refresh_test.rb
vedeu-0.4.18 test/lib/vedeu/output/refresh_test.rb