Sha256: c1d709321941abd63f784ecdcc7051ce9869ad5fef4c5b15b61c54ced761b4ae

Contents?: true

Size: 381 Bytes

Versions: 1

Compression:

Stored size: 381 Bytes

Contents

require "spec_helper"

module Nasty
  describe ExposeBinding do
    it "exposes an objects private binding" do
      item = Object.new
      item.instance_eval do
        @message = "secret"
      end
      item.extend(Nasty::ExposeBinding)
      binding = item.get_binder
      result = ERB.new("<%= @message %>").result(binding)
      result.should == "secret"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nasty-0.0.1388164765 spec/unit/expose_binding_spec.rb