Class: RSpec::Core::ExampleGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-action_view/rspec/example_group.rb

Instance Method Summary collapse

Instance Method Details

#view_engine(type = :erb, &block) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/rspec-action_view/rspec/example_group.rb', line 3

def view_engine type = :erb, &block 
  engine = RSpec::ActionView::ERBTemplateEngine.new
  
  if block
    block.arity < 1 ? engine.instance_eval(&block) : block.call(engine, engine.view)
  end
end

#with_action_view(type = :erb, &block) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/rspec-action_view/rspec/example_group.rb', line 11

def with_action_view type = :erb, &block 
  engine = RSpec::ActionView::ERBTemplateEngine.new
  
  if block
    block.arity < 1 ? engine.view.instance_eval(&block) : block.call(engine.view)
  end
end