Skip to content

Instantly share code, notes, and snippets.

View alloy's full-sized avatar

Eloy Durán alloy

View GitHub Profile
Pasted from LimeChat.app
Anonymous test
obj-c
syntax = tag_to_syntax(@syntaxPopup.selectedItem.tag)
cmd = tag_to_syntax(@commandPopup.selectedItem.tag)
if @result
fire_event('onSend', @result, @button, syntax, cmd, @sheet.frame.size, @mode, @short_text)
else
@conn.cancel if @conn
fire_event('onCancel', syntax, cmd, @sheet.contentView.frame.size, @mode, @short_text)
end
diff --git a/vm.cpp b/vm.cpp
index e88bff5..281d12d 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -2013,13 +2013,13 @@ rb_vm_define_method3(Class klass, SEL sel, rb_vm_block_t *block)
rb_vm_define_method(klass, sel, imp, body, false);
}
-static VALUE method_missing(VALUE obj, SEL sel, int argc, const VALUE *argv,
+static VALUE method_missing(VALUE obj, SEL sel, rb_vm_block_t *block, int argc, const VALUE *argv,
== ActiveSupport
1) Error:
test_signed_round_tripping(MessageEncryptorTest):
SystemStackError: stack level too deep
/Users/eloy/Documents/DEVELOPMENT/RoR/rails2/activesupport/test/../lib/active_support/message_verifier.rb:48:in `next'
/Users/eloy/Documents/DEVELOPMENT/RoR/rails2/activesupport/test/../lib/active_support/message_verifier.rb:48:in `secure_compare'
/Users/eloy/Documents/DEVELOPMENT/RoR/rails2/activesupport/test/../lib/active_support/message_verifier.rb:48:in `each_byte'
/Users/eloy/Documents/DEVELOPMENT/RoR/rails2/activesupport/test/../lib/active_support/message_verifier.rb:48:in `secure_compare'
/Users/eloy/Documents/DEVELOPMENT/RoR/rails2/activesupport/test/../lib/active_support/message_verifier.rb:28:in `verify'
@alloy
alloy / gist:189360
Created September 19, 2009 00:05 — forked from mattetti/gist:189283
require 'rubygems'
require 'active_support'
def rates
o = Object.new
def o.summer_months_nbr
[6, 7, 8, 9]
end
o
end
class Array
# Deletes elements from self for which the block evaluates to +true+ and
# returns the return values as a new array.
#
# Basically, a combination of reject! and map.
#
# a = [1,2,3]
# b = a.take_and_map { |x| x * 2 if x == 2 }
# b # => [4]
# a # => [1, 3]
# Acceptance
Loaded suite test/acceptance/failure_messages_test
Started
FE....
Finished in 0.880999 seconds.
1) Failure:
test_should_display_class_name_and_address_when_expectation_was_on_instance(FailureMessagesTest) [test/acceptance/failure_messages_test.rb:28]:
Expected /#<FailureMessagesTest::Foo:0x[0-9A-Fa-f]{1,12}>/ to match "not all expectations were satisfied\nunsatisfied expectations:\n- expected exactly once, not yet invoked: ##-<FailureMessagesTest::Foo:0x2002db360 @mocha=#-<FailureMessagesTest::Foo:0x2002db360 ...>>.bar(any_parameters)\n".