Check if set is redefining a param at the class level. Fixes #939
This commit is contained in:
parent
f0707c0968
commit
efe52f7cca
20
middleman-core/features/v3_extensions.feature
Normal file
20
middleman-core/features/v3_extensions.feature
Normal file
|
@ -0,0 +1,20 @@
|
|||
Feature: v3 Modular Extension
|
||||
Scenario: Registering and overwriting a system config option
|
||||
Given a fixture app "large-build-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
module MyFeature
|
||||
class << self
|
||||
def registered(app)
|
||||
app.set :css_dir, "lib/my/css"
|
||||
end
|
||||
alias :included :registered
|
||||
end
|
||||
end
|
||||
|
||||
::Middleman::Extensions.register(:my_feature, MyFeature)
|
||||
activate :my_feature
|
||||
"""
|
||||
Given a successfully built app at "large-build-app"
|
||||
When I cd to "build"
|
||||
Then the file "link_test.html" should contain "lib/my/css/test.css"
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
<%= stylesheet_link_tag :test %>
|
|
@ -22,7 +22,7 @@ module Middleman
|
|||
# @param default Attribute value
|
||||
# @return [void]
|
||||
def set(key, default=nil, &block)
|
||||
config.define_setting(key, default)
|
||||
config.define_setting(key, default) unless config.defines_setting?(key)
|
||||
@inst.set(key, default, &block) if @inst
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue