Sha256: 71a732d6ffb60da84305cd32e32f8bef02b6ba22d35af753f39e7e93c1f70dd6

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require 'test_helper'

module Vedeu
  module API
    describe Defined do
      describe '#events' do
        before { Vedeu.events.reset }

        it 'returns no events when none currently registered' do
          Defined.events.must_equal([])
        end

        it 'returns all events currently registered' do
          Vedeu.event(:birthday) { :eat_too_much_cake }

          Defined.events.must_equal([:birthday])
        end
      end

      describe '#groups' do
        before { Vedeu::Groups.reset }

        it 'returns no groups when none currently registered' do
          Defined.groups.must_equal([])
        end

        it 'returns all groups currently registered' do
          Vedeu.interface('hydrogen') { group 'elements' }

          Defined.groups.must_equal(['elements'])
        end
      end

      describe '#interfaces' do
        before { Vedeu::Interfaces.reset }

        it 'returns no interfaces when none currently registered' do
          Defined.interfaces.must_equal([])
        end

        it 'returns all interfaces currently registered' do
          Vedeu.interface('hydrogen') { group 'elements' }

          Defined.interfaces.must_equal(['hydrogen'])
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.1.19 test/lib/vedeu/api/defined_test.rb