Sha256: 37a3f64bced607913aa038c9c3837f35fd94cf343625bfed5adcf0a1e2d60a8f

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require 'test_helper'

module Vedeu

  describe 'Bindings' do
    it { Vedeu.bound?(:_refresh_group_).must_equal(true) }
  end

  module Groups

    describe Refresh do

      let(:described) { Vedeu::Groups::Refresh }
      let(:instance)  { described.new(_name) }
      let(:_name)     { 'Vedeu::Groups::Refresh' }

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }
        it { instance.instance_variable_get('@name').must_equal(_name) }
      end

      describe '.by_name' do
        subject { described.by_name(_name) }

        context 'when the name is not present' do
          let(:_name) { '' }

          it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) }
        end

        context 'when the name is present' do
          it {
            Vedeu::Groups::Refresh.expects(:by_name).with(_name)
            subject
          }
        end
      end

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

    end # Refresh

  end # Groups

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.6.31 test/lib/vedeu/groups/refresh_test.rb
vedeu-0.6.30 test/lib/vedeu/groups/refresh_test.rb