Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #30 from badosu/specify_eval
Browse files Browse the repository at this point in the history
Specify #frame_type when code is evaluated
  • Loading branch information
banister committed May 29, 2013
2 parents 2ccec83 + 6ff5161 commit 5e8ac2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_binding_of_caller.rb
Expand Up @@ -129,6 +129,14 @@ def self.binding; @binding; end
end
end

describe "when evaluated" do
before { @binding = eval("binding.of_caller(0)") }

it 'returns :eval' do
@binding.frame_type.should == :eval
end
end

describe "when inside a block" do
before { @binding = proc { binding.of_caller(0) }.call }

Expand Down

0 comments on commit 5e8ac2d

Please sign in to comment.