🏄♂️
- GitHub Staff
- rickwinfrey.com
- @bashrw
- @rewinfrey@hachyderm.io
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 some_method | |
some_method2 | |
puts "here" | |
end | |
def another_method | |
puts "in another method" | |
return | |
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
class Creator | |
def initialize(input1) | |
@input1 = input1 | |
end | |
def create_lambda | |
->() { | |
puts @input1 | |
} | |
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
def some_method | |
some_method | |
puts "here" | |
end | |
def another_method | |
puts "in another method" | |
return | |
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
def hello | |
puts "hello" | |
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
# Establishing a top level namespace for a given module (Context Library), | |
# that serves as the internal API for a component of a system | |
# is a great way to begin the process of extracting that component | |
# from its containing environment. | |
# Benefits include: | |
# A well defined boundary of responsibilities | |
# More DRY (less duplicated knowledge of the way a component works) | |
# Isolates points of contact between component and containing system | |
# Expresses a clear and simple definition of the component's responsibilities defined by use case |
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
describe AmazonDrone do | |
it "collects order inventory from warehouse" do | |
warehouse = double(:warehouse) | |
order = double(:order) # dummy | |
inventory = double(:inventory) # dummy | |
# set expectations on behavior of warehouse "mock" | |
warehouse.should_receive(:fill_inventory).with(order).and_return(inventory) | |
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
shared_examples_for 'a user search engine' do | |
let(:payment_service) { service_factory.create(:payment) } | |
let(:db) { search_repository } | |
def ids(users) | |
users.map { |user| user[:id] } | |
end | |
def user_search(options) |
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
describe Acme::MessageQueue::SqsMessageQueue do | |
def setup(payload, &block) | |
config = { | |
:access_key => 'first', | |
:secret_key => 'second' | |
} | |
mock_queue = double(:mock_queue) | |
mock_queues = double(:mock_queues) |
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
describe Acme::MessageQueue::SqsMessageQueue do | |
def setup(payload, &block) | |
config = { | |
:access_key => 'first', | |
:secret_key => 'second' | |
} | |
mock_queue = double(:mock_queue) | |
mock_queues = double(:mock_queues) |
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
shared_examples_for 'a user search engine' do | |
let(:payment_service) { service_factory.create(:payment) } | |
let(:db) { search_memory_repository } | |
def ids(users) | |
users.map { |user| user[:id] } | |
end | |
def user_search(options) |
OlderNewer