This file contains 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
Misko, | |
I submitted a fairly large pull request to jasmine-node a couple of weeks ago (https://github.com/mhevery/jasmine-node/pull/105). I wanted to fix the way the verbose version of the TerminalReporter works, since it couldn't parse out nested describe statements from jasmine results. I separated out a TerminalVerboseReporter that creates a nice, colored report in the terminal. | |
I am very excited about this project. I'd like to add further tests around other parts of the app and I am considering adding acceptance tests as well. | |
Unfortunately, I don't see any activity around jasmine-node since December 14th. | |
Would you mind if I forked the project, released it under a new npm and merge the two back together when you're able to work on it again? |
This file contains 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
var observer = { | |
addSubscriber: function(callback) { | |
this.subscribers[this.subscribers.length] = callback; | |
}, | |
removeSubscriber: function(callback) { | |
for (var i = 0; i < this.subscribers.length; i++) { | |
if (this.subscribers[i] === callback) { | |
delete (this.subscribers[i]); | |
} |
This file contains 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
// From the book - Javascript: The Good Parts. | |
// Differential Inheritance | |
var myMammal = { | |
name: 'Herb the Mammal', | |
getName: function() { | |
return this.name; | |
}, | |
says: function() { | |
return this.saying || ''; |
This file contains 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 GivesCreditToPreferredCustomers | |
LOOK_BACK_PERIOD = 3 | |
def self.for_large_orders(sales_amount, added_credit) | |
# the has_large_purchases scope now takes two arguments | |
preferred_customers = Customer.has_large_purchases(sales_amount, LOOK_BACK_PERIOD) | |
preferred_customers.each do |customer| | |
customer.add_credit added_credit | |
end | |
end | |
end |
This file contains 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
... | |
[merge] | |
summary = true | |
tool = p4 | |
[mergetool "p4"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$PWD/$BASE" "$PWD/$LOCAL" "$PWD/$REMOTE" "$PWD/$MERGED" | |
keepBackup = false | |
trustExitCode = false | |
[mergetool] | |
keepBackup = false |
This file contains 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 App.ScoreBoard | |
permutations = | |
[['A_1', 'B_1', 'C_1'], | |
['A_2', 'B_2', 'C_2'], | |
['A_3', 'B_3', 'C_3'], | |
['A_1', 'A_2', 'A_3'], | |
['B_1', 'B_2', 'B_3'], | |
['C_1', 'C_2', 'C_3'], |
This file contains 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 'ostruct' | |
module SortWithOther | |
def <=>(other) | |
if self.send(sort_field).downcase == "Other".downcase | |
1 | |
elsif other.send(sort_field).downcase == "Other".downcase | |
-1 | |
else | |
self.send(sort_field) <=> other.send(sort_field) |
This file contains 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 StringCalculator | |
calculate: (input) -> | |
@validateArgument(input) | |
result = 0 | |
result += parseInt(splitValue) for splitValue in @splitValues(input) | |
result | |
validateArgument: (input) -> |
This file contains 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 ActiveRecord; class Base; end; end | |
# The AR Models Rails give you | |
class User < ActiveRecord::Base | |
# These fields are defined dynamically by ActiveRecord | |
attr_accessor :id, :full_name | |
end | |
class Discussion < ActiveRecord::Base | |
# These fields are defined dynamically by ActiveRecord |
This file contains 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 CarElement | |
def accept(visitor) | |
raise NotImpelementedError.new | |
end | |
end | |
module Visitable | |
def accept(visitor) | |
visitor.visit(self) | |
end |