D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
td-agent
/
embedded
/
lib
/
ruby
/
gems
/
2.1.0
/
gems
/
draper-1.4.0
/
spec
/
draper
/
Filename :
lazy_helpers_spec.rb
back
Copy
require 'spec_helper' module Draper describe LazyHelpers do describe "#method_missing" do let(:decorator) do Struct.new(:helpers){include Draper::LazyHelpers}.new(double) end it "proxies methods to #helpers" do decorator.helpers.stub(:foo).and_return{|arg| arg} expect(decorator.foo(:passed)).to be :passed end it "passes blocks" do decorator.helpers.stub(:foo).and_return{|&block| block.call} expect(decorator.foo{:yielded}).to be :yielded end end end end