lib/usable/mod_extender.rb in usable-1.1.0 vs lib/usable/mod_extender.rb in usable-1.1.1
- old
+ new
@@ -3,11 +3,16 @@
attr_reader :name
attr_accessor :copy, :mod, :config
def initialize(mod, config = OpenStruct.new)
@mod = mod
- @name = mod.name
- @copy = has_spec? ? mod.const_get(:UsableSpec).dup : mod.dup
+ if has_spec?
+ @copy = mod.const_get(:UsableSpec).dup
+ @name = "#{mod.name}UsableSpec"
+ else
+ @copy = mod.dup
+ @name = mod.name
+ end
@config = config
end
# @note Destructive
def call