Commit a3e6760

mo khan <mo@mokhan.ca>
2013-12-27 17:22:19
use eval instead of erb in spec.
1 parent db843b9
Changed files (1)
spec/unit/expose_binding_spec.rb
@@ -3,14 +3,12 @@ require "spec_helper"
 module Nasty
   describe ExposeBinding do
     it "exposes an objects private binding" do
-      item = Object.new
-      item.instance_eval do
+      item = Object.new.instance_eval do
         @message = "secret"
+        self
       end
       item.extend(Nasty::ExposeBinding)
-      binding = item.get_binder
-      result = ERB.new("<%= @message %>").result(binding)
-      result.should == "secret"
+      eval("@message", item.get_binder).should == "secret"
     end
   end
 end