Sha256: 378dc00098d7bb3621b80873d9c64e1bde17a2464704f2b48d57d18670d07a5a

Contents?: true

Size: 867 Bytes

Versions: 2

Compression:

Stored size: 867 Bytes

Contents

require 'hobo/asset_applicator'

describe Hobo::AssetApplicatorRegistry do
  describe "asset_applicators accessor" do
    it "should initialize registry if none exists" do
      Hobo.asset_applicators = nil
      Hobo.asset_applicators.should be_an_instance_of Hobo::AssetApplicatorRegistry
    end

    it "should return registry if exists" do
      Hobo.asset_applicators.register "test" do
        "test"
      end

      Hobo.asset_applicators["test"].should be_an_instance_of Proc
      Hobo.asset_applicators["test"].call.should match "test"
    end
  end

  describe "register" do
    it "should store passed block with pattern" do
      registry = Hobo::AssetApplicatorRegistry.new
      registry.register "abc" do
        "block"
      end

      registry["abc"].should be_an_instance_of Proc
      registry["abc"].call.should match "block"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hobo-inviqa-0.0.7 spec/hobo/asset_applicator_spec.rb
hobo-inviqa-0.0.6 spec/hobo/asset_applicator_spec.rb