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
module CookieStepHelper | |
class Cookies | |
def Cookies.for(session) | |
case session.driver | |
when Capybara::Driver::Selenium | |
SeleniumCookies.new(session.driver) | |
when Capybara::Driver::RackTest | |
RackTestCookies.new(session.driver) | |
when Capybara::Webkit::Driver |
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 normalized_experiments | |
if @experiments.nil? | |
nil | |
else | |
experiment_config = {} | |
@experiments.keys.each do | name | | |
experiment_config[name] = {} | |
end | |
@experiments.each do | experiment_name, settings| | |
experiment_config[experiment_name][:alternatives] = normalize_alternatives(settings[:alternatives]) if settings[:alternatives] |
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
== CreateCopywritings: migrating ============================================= | |
-- create_table(:copywriting_phrases) | |
-> 0.0015s | |
-- add_index(:copywriting_phrases, [:name, :scope]) | |
-> 0.0005s | |
== CreateCopywritings: migrated (0.0021s) ==================================== | |
== CreateCopywritingTranslationTable: migrating ============================== | |
-- rename_column("copywriting_phrase_translations", :copywriting_phrase_id, :refinery_copywriting_phrase_id) | |
rake aborted! |
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
# Activate the gem you are reporting the issue against. | |
gem 'activerecord', '4.1.0' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# Ensure backward compatibility with Minitest 4 | |
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) | |
# This connection will do for database-independent bug reports. |
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
# Activate the gem you are reporting the issue against. | |
gem 'activerecord', '4.1.0' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# Ensure backward compatibility with Minitest 4 | |
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) | |
# This connection will do for database-independent bug reports. |
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 'sinatra' | |
get '/' do | |
<<HTML | |
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> |
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 '[clojure.core.async :as a]) | |
(defn fill-pool | |
[pool n] | |
(doseq [_ (range n)] | |
(a/>!! pool 6))) | |
(defmacro with-client-from-pool | |
[[client-binding pool] & body] | |
`(let [~client-binding (a/<!! ~pool)] |
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
module Sequel | |
module OpenStructValues | |
# Set overrides/defaults for inserting Openstruct | |
def insert_sql(*values) | |
p "Should get called" | |
end | |
end | |
Dataset.register_extension(:open_struct_values, OpenStructValues) | |
end |
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
RSpec.describe Package do | |
let(:package) { described_class.new(owner: owner) } | |
describe '#company_owned?' do | |
subject { package.company_owned? } | |
context 'when owned by User' do | |
let(:owner) { User.new } | |
it { is_expected.to be_truthy } |
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 User; end | |
class Company; end | |
class Package | |
def initialize(owner:) | |
end | |
def cost(distance) | |
end | |
end | |
RSpec.shared_examples 'cheap package' do |
OlderNewer