I hereby claim:
- I am mikepack on github.
- I am mikepack (https://keybase.io/mikepack) on keybase.
- I have a public key ASAoHHutu5Q4xJx7dLfSuriZV7fgxkmWw1XRRm2JTcGM9go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
When testing Ember code, without putting expectations in a Ember.run
callback, you'll get this error:
Failure/Error: Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run
The error recommends wrapping expectations in Ember.run
:
describe 'something', ->
# == Paperclip without ActiveRecord | |
# | |
# Original: https://gist.github.com/basgys/5712426 | |
require 'active_model/naming' | |
require 'active_model/callbacks' | |
require 'active_model/validations' | |
require 'paperclip' | |
require 'paperclip/glue' |
This is a comparision of handling JavaScript alert/confirm/prompt notifications with Capybara. | |
Proposed consolidated API in Capybara: | |
There are two styles of notification handling: proactive or reactive. | |
- Proactive is used in headless environments to queue up responses. | |
- Reactive is used in environments with actual notifications that mandate a response (eg selenium). | |
alert - # Reactive | |
page.driver.accept_alert |
0 enumerator.so | |
1 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/enc/encdb.bundle | |
2 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/enc/trans/transdb.bundle | |
3 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb | |
4 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/rbconfig.rb | |
5 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb | |
6 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb | |
7 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb | |
8 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb | |
9 /Users/Mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/version.rb |
class BinaryPlus | |
def initialize(first, second) | |
@first, @second = first, second | |
# to_s accepts a base to convert to. In this case, base 2. | |
@first_bin = @first.to_s(2) | |
@second_bin = @second.to_s(2) | |
normalize | |
end | |
def + |
# app/something/parent.rb | |
class Parent | |
def path | |
__FILE__ | |
end | |
end | |
# app/something/child.rb | |
class Child < Parent; end |
function SomeClass() {} | |
SomeClass.prototype.do_it = function() { alert('doin it!'); } | |
s = new SomeClass(); | |
function Decorator(klass) { this.__proto__ = klass.__proto__; } | |
d = new Decorator(s) | |
d.do_it() |
class RailsTextPostRenderer | |
def initialize(context) | |
@context = context | |
end | |
def render(model) | |
@context.render(partial: "/posts/text_body", locals: {post: model}) | |
end | |
end |