This file contains hidden or 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
user = User mimic | |
user should receive(firstName: "Guybrush", authenticate!("Guybrush", "lechucksucks") andReturn(true)) | |
user authenticate!(user name, "lechucksucks") should be true |
This file contains hidden or 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
user stub!(:name) andReturn("Guybrush Threepwood") | |
user mock!(:occupation) andReturn("Fearsome Pirate") anyNumberOfTimes |
This file contains hidden or 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
JavaGround java:sql:ResultSet do( | |
mimic!(Mixins Enumerable) | |
each = dmacro( | |
[code] | |
while(self next, code evaluateOn(call ground, Rekoird Row mimic(self))) | |
self, | |
[argName, code] | |
lexical = call LexicalBlock createFrom(call list(argName, code), call ground) |
This file contains hidden or 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
Message from = dmacro( | |
"returns the message chain for the argument given", | |
[code] | |
code deepCopy) |
This file contains hidden or 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
*** - couldn't find cell 'name' on 'Origin_0x295106F' (Condition Error NoSuchCell) |
This file contains hidden or 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
["Guybrush", "Elaine", "LeChuck"].each {|name| puts "Hello #{name}"} |
This file contains hidden or 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
["Guybrush", "Elaine", "LeChuck"] each(name, "Hello #{name}" println) |
This file contains hidden or 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 BetterToInteger | |
def self.included(string_class) | |
string_class.alias_method_chain :to_i, :logging | |
end | |
def to_i_with_logging | |
returning(to_i_without_logging) do |new_value| | |
logger.log "Converting from #{self} to #{new_value}" | |
end | |
end |
This file contains hidden or 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
irb(main):003:0> "".method(:to_widget) | |
=> #<Method: String#to_widget> | |
irb(main):003:0> "".method(:to_widget) | |
=> #<Method: String#to_widget> | |
irb(main):003:0> "".method(:to_widget) | |
=> #<Method: String(StringExtensions)#to_widget> |
This file contains hidden or 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 String | |
def to_widget | |
Widget.new self.gsub(/foo/, "bar") | |
end | |
end |