lib/lookbook/preview_example.rb in lookbook-1.0.8 vs lib/lookbook/preview_example.rb in lookbook-1.1.0
- old
+ new
@@ -4,10 +4,10 @@
delegate :params, :position, :group, :notes, :hidden?, :source, :tags, :tag, to: :@example_inspector
def initialize(name, preview, code_object)
@name = name
@preview = preview
- @example_inspector = SourceInspector.new(code_object)
+ @example_inspector = SourceInspector.new(code_object, eval_scope: @preview.preview_class.new)
super("#{@preview.path}/#{name}")
end
def id
@example_inspector&.id || generate_id(@preview.id, name)