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 MyClass do | |
it "retrieves data from the data store" do | |
data = stub | |
# should_receive would be redundant here because the assertion confirms | |
# data was passed through. | |
DataStore.stub!(:find_data).and_return(data) | |
subject.data.should == data | |
end | |
it "sends an email to the user" do |
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
>>> xrange(2 ** 100) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
OverflowError: long int too large to convert to int |
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
commit 0e4888f0e49557cdf36e38a91a74f462a1206fc4 | |
Author: Sumeet Agarwal <sumeet.a@gmail.com> | |
Date: Thu Sep 27 22:05:22 2012 -0700 | |
add test for accessing let through the class | |
diff --git a/test/test_case_test.py b/test/test_case_test.py | |
index 66f6fd3..2bd2875 100644 | |
--- a/test/test_case_test.py | |
+++ b/test/test_case_test.py |
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
BoldAsFont=yes | |
Font=monofur | |
FontHeight=14 | |
FontSmoothing=full | |
AllowBlinking=yes | |
Locale=en_US | |
Charset=UTF-8 | |
Scrollbar=none | |
FontIsBold=no |
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
#!/usr/bin/env python | |
import pygments | |
import re | |
import sys | |
from pygments.lexers import RubyLexer | |
from pygments.formatters import TerminalFormatter | |
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
Traceback (most recent call last): | |
File "blah.py", line 3, in <module> | |
requests.get("FUCK") | |
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/api.py", line 55, in get | |
return request('get', url, **kwargs) | |
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/api.py", line 44, in request | |
return session.request(method=method, url=url, **kwargs) | |
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/sessions.py", line 422, in request | |
prep = self.prepare_request(req) | |
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/sessions.py", line 360, in prepare_request |
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 "blah" do | |
let(:blah) { 123 } | |
it "blah" do | |
self.class.let(:blah) { 234 } | |
blah.should == 234 | |
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
[0] % yes | head -n 20 | parallel cat | |
When using programs that use GNU Parallel to process data for publication please cite: | |
O. Tange (2011): GNU Parallel - The Command-Line Power Tool, | |
;login: The USENIX Magazine, February 2011:42-47. | |
This helps funding further development; and it won't cost you a cent. | |
Or you can get GNU Parallel without this requirement by paying 10000 EUR. | |
To silence this citation notice run 'parallel --bibtex' once or use '--no-notice'. |
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 "json" | |
require "yaml" | |
cassette_files = `git ls-files features/cassettes spec/vcr_cassettes | grep yml$`.split | |
p cassette_files | |
cassette_files.each do |filename| | |
yaml = YAML.load_file filename | |
yaml.fetch("http_interactions").each do |interaction| |
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
" Remove extra whitespace before saving | |
function! <SID>StripTrailingWhitespaces() | |
" Preparation: save last search, and cursor position. | |
let _s=@/ | |
let l = line(".") | |
let c = col(".") | |
" Do the business: | |
%s/\s\+$//e | |
" Clean up: restore previous search history, and cursor position | |
let @/=_s |