Skip to content

Commit 62b7332

Browse files
committed
Add test for initial binding
1 parent ee261ba commit 62b7332

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/web_console/session_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ def initialize(line)
3939
assert_equal session.eval('__FILE__'), "=> \"#{__FILE__}\"\n"
4040
end
4141

42+
test 'use first binding if no application bindings' do
43+
binding = Object.new
44+
binding.expects(:eval).with('__FILE__').returns 'framework'
45+
binding.expects(:eval).with('called?').returns 'yes'
46+
47+
session = Session.new(binding)
48+
assert_equal session.eval('called?'), "=> \"yes\"\n"
49+
end
50+
4251
test '#from can create session from a single binding' do
4352
saved_line, saved_binding = __LINE__, binding
4453
Thread.current[:__web_console_binding] = saved_binding

0 commit comments

Comments
 (0)