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
| #!/bin/bash | |
| # Date helper functions | |
| get_year_dates() { | |
| local year=${1:-$(date +%Y)} | |
| local start="${year}-01-01T00:00:00Z" | |
| local end="${year}-12-31T23:59:59Z" | |
| echo "$start $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
| Rails as it has never been before :) |
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
| require "object_mock" | |
| require "rubygems" | |
| require "shoulda" | |
| class ObjectMockTest < Test::Unit::TestCase | |
| context "With class X" do | |
| setup do | |
| class X | |
| def m; "m"; 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
| # A group of methods added to Object class to enable simple mocking | |
| # of instance or class methods. | |
| # This mocking can be done temporarily within the scope of a block. | |
| # Alternatively it can be done indefinitely until explicitly undone. | |
| class Object | |
| # method for mocking or adding methods for a single object | |
| # (or class methods if the object is a class instance) | |
| # methods: a comma separated key value pairs |