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
# Originally from https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Enable the 2D Dock | |
defaults write com.apple.dock no-glass -bool true | |
# Disable menu bar transparency | |
defaults write -g AppleEnableMenuBarTransparency -bool false | |
# Expand save panel by default | |
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true |
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
.gist-syntax { background: #ffffff; } | |
.gist-syntax .c { color: #999988; font-style: italic } /* Comment */ | |
.gist-syntax .err { color: #a61717; background-color: #e3d2d2 } /* Error */ | |
.gist-syntax .k { color: #000000; font-weight: bold } /* Keyword */ | |
.gist-syntax .o { color: #000000; font-weight: bold } /* Operator */ | |
.gist-syntax .cm { color: #999988; font-style: italic } /* Comment.Multiline */ | |
.gist-syntax .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ | |
.gist-syntax .c1 { color: #999988; font-style: italic } /* Comment.Single */ | |
.gist-syntax .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ | |
.gist-syntax .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ |
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
pre.code { background: #181818; padding: 16px; color: #F8F8F8; font-family: Consolas, Monaco,"Lucida Console"; } | |
pre.code * { font-family: Consolas, Monaco,"Lucida Console"; } | |
pre.code .hll { background-color: #ffffcc } | |
pre.code .c { color: #5F5A60; font-style: italic } /* Comment */ | |
pre.code .err { border:#B22518; } /* Error */ | |
pre.code .k { color: #CDA869 } /* Keyword */ | |
pre.code .cm { color: #5F5A60; font-style: italic } /* Comment.Multiline */ | |
pre.code .cp { color: #5F5A60 } /* Comment.Preproc */ | |
pre.code .c1 { color: #5F5A60; font-style: italic } /* Comment.Single */ | |
pre.code .cs { color: #5F5A60; font-style: italic } /* Comment.Special */ |
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
GEM | |
remote: http://ruby.taobao.org/ | |
specs: | |
activesupport (3.2.3) | |
i18n (~> 0.6) | |
multi_json (~> 1.0) | |
addressable (2.2.7) | |
chunky_png (1.2.5) | |
coffee-script (2.2.0) | |
coffee-script-source |
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
calculator = (method, numbers...) -> | |
switch method | |
when 'multiple' then @multiple(numbers) | |
when 'addition' then @addition(numbers) | |
when 'minus' then @minus(numbers) | |
when 'divide' then @divide(numbers) | |
else | |
throw new Error "method doesn't exist" | |
multiple = (numbers) -> |
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
describe "calculator", -> | |
it "should throw an error if no method is matched", -> | |
calculatorSpy = sinon.spy sample, 'calculator' | |
try | |
sample.calculator('non-exist-method', 1, 2) | |
catch e | |
sinon.assert.threw(calculatorSpy) |
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
it "should call the given method when parameter is valid", -> | |
multipleSpy = sinon.spy sample, 'multiple' | |
sample.calculator('multiple', 1, 2) | |
sinon.assert.calledOnce(multipleSpy) | |
sinon.assert.calledWithExactly(multipleSpy, [1, 2]) |
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
sample = require('../sample') | |
assert = require('assert') | |
sinon = require('sinon') | |
describe "calculator", -> | |
before -> | |
@calculator = sinon.spy sample, 'calculator' | |
@multiple = sinon.spy sample, 'multiple' | |
@addition = sinon.spy sample, 'addition' | |
@minus = sinon.spy sample, 'minus' |
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
it "should call the given method when parameter is valid", -> | |
sample.calculator('minus', 1) | |
sinon.assert.calledOnce(@[method]) |
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
describe "calculator", -> | |
it "should call the given method when parameter is valid", -> | |
# stub the method instead of just 'spying' it | |
minusStub = sinon.stub sample, 'minus' | |
methods = ['multiple', 'addition', 'minus', 'divide'] | |
sample.calculator('minus', 1) | |
sinon.assert.calledOnce(minusStub) | |
sinon.assert.calledWithExactly(minusStub, [1]) |
OlderNewer