Sha256: d5ad619cadf1f195456a0e037b38825285c42d03cb7d2e82d162db596a4950a1

Contents?: true

Size: 885 Bytes

Versions: 28

Compression:

Stored size: 885 Bytes

Contents

require "#{File.dirname(__FILE__)}/../../test_helper"

class DslBaseTest < Test::Unit::TestCase
  context "DslBase" do
    setup do
      @base = PoolParty::DslBase.new
    end
    
    should "have the method instances" do
      @base.maximum_instances 20
      assert_equal 2, @base.minimum_instances
      assert_equal 20, @base.maximum_instances
      @base.instances 1
      assert_equal 1, @base.minimum_instances
      assert_equal 1, @base.maximum_instances      
      @base.instances 3..20
      assert_equal 3, @base.minimum_instances
      assert_equal 20, @base.maximum_instances
    end
    
    should "throw an error if instances are given an invalid instance" do
      PoolParty::PoolPartyError.create("DslMethodCall") # To make sure the constant is defined below
      assert_raises DslMethodCall do
        @base.instances "box"
      end
    end
    
  end  
  
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
auser-poolparty-1.3.0 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.1 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.10 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.11 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.12 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.13 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.14 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.15 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.16 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.17 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.2 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.3 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.4 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.5 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.6 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.7 test/lib/poolparty/dsl_base_test.rb
auser-poolparty-1.3.8 test/lib/poolparty/dsl_base_test.rb
fairchild-poolparty-1.3.17 test/lib/poolparty/dsl_base_test.rb
fairchild-poolparty-1.3.5 test/lib/poolparty/dsl_base_test.rb
poolparty-1.3.15 test/lib/poolparty/dsl_base_test.rb