Sha256: 3f17b1fb292ff5b78fad0904a6940e4fb4b0130f231d205ad494326abef4e441

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'

class IntrospectionTest < GemeraldBeanstalkTest

  context 'autoload' do

    should 'automatically load plugin' do
      GemeraldBeanstalk::Beanstalk.expects(:load_plugin).with(:Introspection)
      load 'gemerald_beanstalk/plugins/introspection.rb'
    end

  end


  context 'instance methods' do

    setup do
      @beanstalk = GemeraldBeanstalk::Beanstalk.new('localhost:11300')
      @beanstalk.extend(GemeraldBeanstalk::Plugin::Introspection)
    end


    context '#connections' do

      should 'return the beanstalk instance connections object' do
        assert_equal @beanstalk.instance_variable_get(:@connections), @beanstalk.connections
      end

    end


    context '#jobs' do

      should 'return the compacted beanstalk instance jobs object' do
        assert_equal @beanstalk.instance_variable_get(:@jobs).compact, @beanstalk.jobs
      end

    end


    context '#tubes' do

      should 'return the beanstalk instance active_tubes' do
        @beanstalk.expects(:active_tubes).once.returns({})
        @beanstalk.tubes
      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemerald_beanstalk-0.1.0 test/unit/plugins/introspection_test.rb