Sha256: 9a5fde476c7aa84be4da709b50c941cc79f035aa714d1e7cabf4511715610311

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

module Vedeu

  module Output

    describe Refresh do

      let(:described) { Vedeu::Output::Refresh }
      let(:instance)  { described.new }

      describe '.all' do
        before { Vedeu.stubs(:trigger) }

        subject { described.all }

        it { subject.must_be_instance_of(Array) }

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

          it { subject.must_equal([]) }
        end

        context 'when there are registered interfaces' do
          let(:interface)  {
            Vedeu::Models::Interface.new(name: 'Vedeu::Output::Refresh')
          }
          let(:interfaces) { [interface] }

          before { Vedeu.interfaces.stubs(:zindexed).returns(interfaces) }

          it {
            Vedeu.expects(:trigger).with(:_refresh_, 'Vedeu::Output::Refresh')
            subject
          }

          it { subject.must_equal([interface]) }
        end
      end

      describe '#all' do
        it { instance.must_respond_to(:all) }
      end

    end # Refresh

  end # Output

end # Vedeu

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.6.16 test/lib/vedeu/output/refresh/refresh_test.rb
vedeu-0.6.15 test/lib/vedeu/output/refresh/refresh_test.rb
vedeu-0.6.14 test/lib/vedeu/output/refresh/refresh_test.rb
vedeu-0.6.13 test/lib/vedeu/output/refresh/refresh_test.rb
vedeu-0.6.12 test/lib/vedeu/output/refresh/refresh_test.rb
vedeu-0.6.11 test/lib/vedeu/output/refresh/refresh_test.rb