Sha256: 6c090270fca6e436bfba82ee9191b9a5953186f45854e9912c81bee795a83c77

Contents?: true

Size: 828 Bytes

Versions: 14

Compression:

Stored size: 828 Bytes

Contents

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

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

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

  describe "register" do
    it "should store passed block with pattern" do
      registry = Hem::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

14 entries across 14 versions & 1 rubygems

Version Path
hem-1.2.4 spec/hem/asset_applicator_spec.rb
hem-1.2.3 spec/hem/asset_applicator_spec.rb
hem-1.2.2 spec/hem/asset_applicator_spec.rb
hem-1.2.1 spec/hem/asset_applicator_spec.rb
hem-1.2.0 spec/hem/asset_applicator_spec.rb
hem-1.1.2 spec/hem/asset_applicator_spec.rb
hem-1.1.1 spec/hem/asset_applicator_spec.rb
hem-1.1.0 spec/hem/asset_applicator_spec.rb
hem-1.0.1.beta6 spec/hem/asset_applicator_spec.rb
hem-1.0.1.beta5 spec/hem/asset_applicator_spec.rb
hem-1.0.1.beta4 spec/hem/asset_applicator_spec.rb
hem-1.0.1.beta3 spec/hem/asset_applicator_spec.rb
hem-1.0.1.beta2 spec/hem/asset_applicator_spec.rb
hem-1.0.1.beta1 spec/hem/asset_applicator_spec.rb