Sha256: 3d9b71e156db682bf5bbe2901b5c8d1af2e2b508031502c8dd3ec6298095206a

Contents?: true

Size: 831 Bytes

Versions: 5

Compression:

Stored size: 831 Bytes

Contents

require 'test_helper'

module Vedeu

  describe Groups do

    let(:described) { Vedeu::Groups }

    it { described.must_respond_to(:groups) }

    describe '.reset!' do
      subject { described.reset! }

      it {
        described.expects(:register).with(Vedeu::Group)
        subject
      }
    end

    describe '#by_name' do
      let(:_name) { 'carbon' }

      subject { described.groups.by_name(_name) }

      context 'when the group exists' do
        before do
          Vedeu.group 'carbon' do
          end
        end
        after { Vedeu.groups.reset }

        it { subject.must_be_instance_of(Vedeu::Group) }
      end

      context 'when the group does not exist' do
        let(:_name) { 'nitrogen' }

        it { subject.must_be_instance_of(Vedeu::Group) }
      end
    end

  end # Groups

end # Vedeu

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.4.45 test/lib/vedeu/repositories/repositories/groups_test.rb
vedeu-0.4.44 test/lib/vedeu/repositories/repositories/groups_test.rb
vedeu-0.4.43 test/lib/vedeu/repositories/repositories/groups_test.rb
vedeu-0.4.42 test/lib/vedeu/repositories/repositories/groups_test.rb
vedeu-0.4.41 test/lib/vedeu/repositories/repositories/groups_test.rb