Sha256: 3fb6a735452abeb05a8949a3a5635f11595eea3828621702583acb4757f6d557

Contents?: true

Size: 1.13 KB

Versions: 17

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

require 'rake'
class TestTasks < Test::Unit::TestCase
  include Rake

  context 'instantiating Juwelier::Tasks' do
    setup do
      @gemspec_building_block = lambda {|gemspec|}
      @tasks = Juwelier::Tasks.new &@gemspec_building_block
    end

    teardown do
      Task.clear
    end

    should 'assign @gemspec' do
      assert_not_nil @tasks.gemspec
    end

    should 'not eagerly initialize Juwelier' do
      assert ! @tasks.instance_variable_defined?(:@juwelier)
    end

    should 'set self as the application-wide juwelier tasks' do
      assert_same @tasks, Rake.application.juwelier_tasks
    end

    should 'save gemspec building block for later' do
      assert_same @gemspec_building_block, @tasks.gemspec_building_block
    end

    context 'Juwelier instance' do
      setup do
        @tasks.juwelier
      end

      should 'initailize Juwelier' do
        assert @tasks.instance_variable_defined?(:@juwelier)
      end
    end

    should 'yield the gemspec instance' do
      spec = nil
      @tasks = Juwelier::Tasks.new { |s| spec = s }
      assert_not_nil @tasks.juwelier.gemspec
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
juwelier-2.4.9 test/juwelier/test_tasks.rb
juwelier-2.4.7 test/juwelier/test_tasks.rb
juwelier-2.4.6 test/juwelier/test_tasks.rb
juwelier-2.4.5 test/juwelier/test_tasks.rb
juwelier-2.4.4 test/juwelier/test_tasks.rb
juwelier-2.4.1 test/juwelier/test_tasks.rb
juwelier-2.4.0 test/juwelier/test_tasks.rb
juwelier-2.3.6 test/juwelier/test_tasks.rb
juwelier-2.3.4 test/juwelier/test_tasks.rb
juwelier-2.3.2 test/juwelier/test_tasks.rb
juwelier-2.3.0 test/juwelier/test_tasks.rb
juwelier-2.2.3 test/juwelier/test_tasks.rb
juwelier-2.2.1 test/juwelier/test_tasks.rb
juwelier-2.1.3 test/juwelier/test_tasks.rb
juwelier-2.1.2 test/juwelier/test_tasks.rb
juwelier-2.1.1 test/juwelier/test_tasks.rb
juwelier-2.1.0 test/juwelier/test_tasks.rb