Skip to content

Instantly share code, notes, and snippets.

it 'should do something' do
on_failure warn_that "@foo shouldn't be nil" do
@foo.should_not be_nil
end
end
function debugAccess(obj, prop, debugGet){
var origValue = obj[prop];
var newKey = "__debug_access_"+prop;
obj[newKey] = origValue;
Object.defineProperty(obj, prop, {
get: function () {
if (this !== obj && this.hasOwnProperty(newKey)) {
console.log("Inherited object gets its existing COPY of '", prop, "' in ", newKey);
return this[newKey];