Sha256: 3af119a420628e5a43ac37559ca265a22efd9968958236eae3f247ae35c0de5a

Contents?: true

Size: 831 Bytes

Versions: 15

Compression:

Stored size: 831 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'minitest/autorun'
require 'webgen/task'

class Webgen::Task::SampleTestTask

  def self.call(website, other)
    other
  end

end

class TestTask < Minitest::Test

  def setup
    @website = :dummy
    @task = Webgen::Task.new(@website)
  end

  def test_register_and_data
    @task.register('SampleTestTask', :data => :data)
    assert(@task.registered?('sample_test_task'))
    assert_equal(:data, @task.data('sample_test_task'))

    @task.register('doit') {|website|}
    assert(@task.registered?('doit'))
  end

  def test_execute
    @task.register('SampleTestTask')
    @task.register('doit') do |website, param|
      [website, param]
    end

    assert_equal([@website, :data], @task.execute('doit', :data))
    assert_equal(:data, @task.execute('sample_test_task', :data))
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webgen-1.7.3 test/webgen/test_task.rb
webgen-1.7.2 test/webgen/test_task.rb
webgen-1.7.1 test/webgen/test_task.rb
webgen-1.7.0 test/webgen/test_task.rb
webgen-1.6.0 test/webgen/test_task.rb
webgen-1.5.2 test/webgen/test_task.rb
webgen-1.5.1 test/webgen/test_task.rb
webgen-1.5.0 test/webgen/test_task.rb
webgen-1.4.1 test/webgen/test_task.rb
webgen-1.4.0 test/webgen/test_task.rb
webgen-1.3.0 test/webgen/test_task.rb
webgen-1.2.1 test/webgen/test_task.rb
webgen-1.2.0 test/webgen/test_task.rb
webgen-1.1.0 test/webgen/test_task.rb
webgen-1.0.0 test/webgen/test_task.rb