This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RouteFor | |
include ::Spec::Rails::Example::RoutingHelpers::ParamsFromQueryString | |
TEST_ROUTABILITY="<test routabilty only>" | |
def initialize(example, options) | |
@example, @options = example, options | |
end | |
def routable? | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'spork' | |
ENV["RAILS_ENV"] ||= 'test' | |
Spork.prefork do | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
# need to restart spork for it take effect. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= A sampling of problems found = | |
== Doesn't generate XML for index.xml == | |
'TopicsController responding to GET index when there are topics with mime type of xml should render all topics as xml' FAILED | |
expected: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<topics type=\"array\">\n <topic>\n <created-at type=\"datetime\">2009-03-08T20:46:47Z</created-at>\n <current-hat>Red</current-hat>\n <current-thought-id type=\"integer\" nil=\"true\"></current-thought-id>\n <id type=\"integer\">1</id>\n <name>generated string # 3</name>\n <summary>generated string # 4</summary>\n <updated-at type=\"datetime\">2009-03-08T20:46:47Z</updated-at>\n <user-id type=\"integer\">4</user-id>\n </topic>\n</topics>\n", | |
got: " " (using ==) | |
./spec/controllers/topics_controller_spec.rb:38: | |
./spec/controllers/topics_controller_spec.rb:3: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets up the Rails environment for Cucumber | |
ENV["RAILS_ENV"] = "test" | |
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
require 'cucumber/rails/world' | |
require 'cucumber/formatters/unicode' # Comment out this line if you don't want Cucumber Unicode support | |
Cucumber::Rails.use_transactional_fixtures | |
require 'webrat' | |
require "webrat/rails" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'should do something' do | |
on_failure warn_that "@foo shouldn't be nil" do | |
@foo.should_not be_nil | |
end | |
end |