I hereby claim:
- I am ystros on github.
- I am ystros (https://keybase.io/ystros) on keybase.
- I have a public key whose fingerprint is 3E11 823D 0167 6AEC 4E37 EF54 99AF EBBA 1CB2 984E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# action key | |
set -g prefix C-a | |
set-option -g default-command "reattach-to-user-namespace -l bash" | |
# vi keys | |
set-window-option -g mode-keys vi | |
bind-key -t vi-copy 'v' begin-selection | |
bind-key -t vi-copy 'y' copy-selection | |
# windows |
module RSpec | |
module SafeMocks | |
class MethodMustExistError < Exception | |
end | |
module Methods | |
def safe_stub(message_or_hash, opts={}, &block) | |
messages = Hash === message_or_hash ? message_or_hash.keys : Array.wrap(message_or_hash.to_sym) | |
messages.each do |message| | |
raise RSpec::SafeMocks::MethodMustExistError, "Stubbed method #{message.inspect} does not exist on #{self.inspect}" unless self.respond_to?(message) |
class User | |
validates :some_attribute, :presence => true | |
end | |
class DeviseSignInUnintendedSaveController | |
def foo | |
user.update_attributes :some_attribute => nil # returns false; user.some_attribute is not nil in the database | |
sign_in user # oops! This bypasses validation when saving Devise specific fields, so the invalid change above gets persisted. | |
end | |
end |