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
// I'd think that if NSString doesn't get sent stringWithFormat here before the end of this test, it should raise an error? It's mocking after all, not stubbing. | |
- (void)testClassMethodMocking { | |
[NSString mock:@selector(stringWithFormat:) andReturn:@"someString"]; | |
NSString *string = [NSString stringWithFormat@"abc123"]; | |
GHAssertEqual(string, @"someString", "NSString hasn't been mocked") | |
} | |
// This guy wouldn't raise. |
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
ProxyRequests Off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> | |
ProxyPass /app http://foo.heroku.com | |
ProxyPassReverse /app http://foo.heroku.com |
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
(function($) { | |
$.fn.credit_card = function(opts) { | |
this.opts = opts | |
this.change(function(){ | |
var val = $(this).val() | |
if (val[0] == "4"){ | |
$(opts.visa).addClass("highlighted"); | |
return false; | |
} |
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
shops = self.find_by_sql([" | |
SELECT s.*, | |
make_rating(user_rating.avg, admin_rank.avg) AS rating, | |
admin_rank.avg AS admin_rank, | |
enumerable_rating.rank AS ranking | |
FROM categories_shops cs, | |
shops AS s | |
LEFT OUTER JOIN | |
-- Take Users ratings and join them | |
(SELECT s.id, avg(r.rating) AS avg |
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
$.fn.helpBubble = function() { | |
var widget = $(this); | |
$(this).prepend("<div class=\"information\"><a href='javascript:void(0);'><img src='/images/information.png' /></a></div>"); | |
var info = $(".information"); | |
info.css({ | |
"position": "absolute", | |
"margin" : "-1px 0 0 " + (widget.innerWidth() - 17) + "px" | |
}); | |
var info = widget.find(".infomation"); | |
var title = widget.attr("title"); |
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
☠ Can view all articles in a sector | |
NativeException - com.gargoylesoftware.htmlunit.ScriptException: Exception invoking jsxFunction_getComputedStyle | |
(druby://127.0.0.1:55134) /usr/local/Cellar/gems/1.8/gems/akephalos-0.2.5/lib/akephalos/client.rb:76:in `visit' | |
(druby://127.0.0.1:55134) org/jruby/RubyKernel.java:2042:in `send' | |
(druby://127.0.0.1:55134) file:/usr/local/Cellar/gems/1.8/gems/jruby-jars-1.6.0/lib/jruby-stdlib-1.6.0.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1593:in `perform_without_block' | |
(druby://127.0.0.1:55134) file:/usr/local/Cellar/gems/1.8/gems/jruby-jars-1.6.0/lib/jruby-stdlib-1.6.0.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1553:in `perform' | |
(druby://127.0.0.1:55134) file:/usr/local/Cellar/gems/1.8/gems/jruby-jars-1.6.0/lib/jruby-stdlib-1.6.0.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1627:in `main_loop' | |
(druby://127.0.0.1:55134) org/jruby/RubyKernel.java:1417:in `loop' | |
(druby://127.0.0.1:55134) file:/usr/local/Cellar/gems/1.8/gems/jruby-jars-1.6.0/lib/jru |
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
>> Image.facets | |
NoMethodError: undefined method `title' for "finance":String | |
from /usr/local/Cellar/gems/1.8/gems/thinking-sphinx-2.0.1/lib/thinking_sphinx/facet.rb:107:in `send' | |
from /usr/local/Cellar/gems/1.8/gems/thinking-sphinx-2.0.1/lib/thinking_sphinx/facet.rb:107:in `translate' | |
from /usr/local/Cellar/gems/1.8/gems/thinking-sphinx-2.0.1/lib/thinking_sphinx/facet.rb:80:in `value' | |
from /usr/local/Cellar/gems/1.8/gems/thinking-sphinx-2.0.1/lib/thinking_sphinx/facet_search.rb:125:in `add_from_results' | |
from /usr/local/Cellar/gems/1.8/gems/thinking-sphinx-2.0.1/lib/thinking_sphinx/search.rb:273:in `each_with_match' | |
from /usr/local/Cellar/gems/1.8/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:400:in `each_with_index' | |
from /usr/local/Cellar/gems/1.8/gems/thinking-sphinx-2.0.1/lib/thinking_sphinx/search.rb:272:in `each' | |
from /usr/local/Cellar/gems/1.8/gems/thinking-sphinx-2.0.1/lib/thinking_sphinx/search.rb:272:in `each_with_index' |
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
@implementation InspectionFollowupDateToPropertyMigration | |
- (BOOL)createRelationshipsForDestinationInstance:(NSManagedObject *)source entityMapping:(NSEntityMapping *)mapping | |
manager:(NSMigrationManager *)manager error:(NSError **)error | |
{ | |
NSMutableSet *inspections = [source valueForKey:@"inspections"]; | |
for (id inspection in inspections) | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
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
>> re = Course.search "Short Course", :conditions => {:categories_facet => "category-2"} | |
>> re.each{|r| p r.categories.map{|c| c.index_slug}.include?("category-2")} | |
true | |
false | |
true | |
false | |
false | |
false | |
false |
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
>> Course.make | |
ActiveRecord::RecordInvalid: Validation failed: Index slug has already been taken | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_record/validations.rb:49:in `save!' | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_record/attribute_methods/dirty.rb:30:in `save!' | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_record/transactions.rb:242:in `save!' | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_record/transactions.rb:289:in `with_transaction_returning_status' | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction' | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_record/transactions.rb:204:in `transaction' | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_record/transactions.rb:287:in `with_transaction_returning_status' | |
from /usr/local/Cellar/gems/1.8/gems/activerecord-3.0.3/lib/active_recor |