Sha256: 47a0dcc95abc32d34ce2d45c80740ee75e9ae2a50895d92f9f974240799366d2

Contents?: true

Size: 660 Bytes

Versions: 8

Compression:

Stored size: 660 Bytes

Contents

# encoding: utf-8

class Nanoc3::PluginTest < MiniTest::Unit::TestCase

  include Nanoc3::TestHelpers

  class SampleFilter < Nanoc3::Filter
    identifier :_plugin_test_sample_filter
  end

  def test_named
    # Find existant filter
    filter = Nanoc3::Filter.named(:erb)
    assert(!filter.nil?)

    # Find non-existant filter
    filter = Nanoc3::Filter.named(:lksdaffhdlkashlgkskahf)
    assert(filter.nil?)
  end

  def test_register
    SampleFilter.send(:identifier, :_plugin_test_sample_filter)

    registry = Nanoc3::PluginRegistry.instance
    filter = registry.find(Nanoc3::Filter, :_plugin_test_sample_filter)

    refute_nil filter
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc3-3.2.4 test/base/test_plugin.rb
nanoc3-3.2.3 test/base/test_plugin.rb
nanoc3-3.2.2 test/base/test_plugin.rb
nanoc3-3.2.1 test/base/test_plugin.rb
nanoc3-3.2.0 test/base/test_plugin.rb
nanoc3-3.2.0b3 test/base/test_plugin.rb
nanoc3-3.2.0b2 test/base/test_plugin.rb
nanoc3-3.2.0b1 test/base/test_plugin.rb