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_relative 'test_helper' | |
require 'rack/test' | |
require 'minitest/autorun' | |
require 'capybara' | |
require 'capybara/dsl' | |
include Capybara::DSL | |
def app | |
MyApp::Server |
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
def hash_options(args, defaults) | |
args.assert_valid_keys(*defaults.keys) | |
defaults.merge(args).values | |
end | |
def my_method(args = {}) | |
some, other, blah = | |
*hash_options(args, :some => 'value', other: 'value 2', blah: 'value 3') | |
# Use |
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 Organization | |
def to_param | |
"42" | |
end | |
def saved? | |
rand > 0.5 | |
end | |
end | |
class OrganizationCreator |
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 'bundler' | |
Bundler.setup | |
require 'mongoid' | |
require 'rspec/autorun' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("has_many_bug") | |
end | |
class Kid |
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
/* What should the Resharper output of the current UI look like? | |
In my version (0.4.13) the following is shown: | |
EnumerableExtensions, and both enumerables contain the same items | |
should indicate that the enumerables are equal | |
I would have expected it to show something like: | |
EnumerableExtensions, when comparing two enumerables for item equality and both enumerables contain the same items | |
should indicate that the enumerables are equal |
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
(define (my-for-each proc values) | |
(if (null? values) | |
#t | |
(let () | |
(proc (car values)) | |
(my-for-each proc (cdr values))))) | |
(import srfi-1) | |
(use srfi-1) |
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 'rspec' | |
class Quiz | |
def self.answer(question) | |
42 | |
end | |
end | |
# Test |
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
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. | |
# It is recommended to regenerate this file in the future when you upgrade to a | |
# newer version of cucumber-rails. Consider adding your own code to a new file | |
# instead of editing this one. Cucumber will automatically load all features/**/*.rb | |
# files. | |
ENV["RAILS_ENV"] ||= "test" | |
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support |