Skip to content

Instantly share code, notes, and snippets.

Array
(
[0] => a
[1] => b
[2] => c
)
Array
(
[0] => a
[2] => c
$ bzr unshelve
Unshelving changes with id "1".
bzr: ERROR: exceptions.NotImplementedError: <property object at 0x97b370c>
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 842, in exception_to_return_code
return the_callable(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 1037, in run_bzr
ret = run(*run_argv)
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 654, in run_argv_aliases
Feature: Dashboard
In order to not explode from frustration
a developer
does not want rspec stubs to leak between scenarios
Scenario: Create a stub
When I stub nap time to "When I Get Cranky"
Then nap time should be "When I Get Cranky"
Scenario: Check to see if the stub leaked
# given these specs for a should_hide?(options={}) method
describe 'utility methods' do
describe 'should_hide?' do
describe 'individual options' do
describe 'show_when' # ...
describe 'show_unless' # ...
describe 'hide_when' # ...
describe 'hide_unless' # ...
end
h = {
:one => 1,
:two => 2,
:three => 3
}
puts "-- *args"
h.inject({}) do |*args|
puts args.inspect
break
sh: line 1: 7573 Segmentation fault bzr update /home/user/.cerberus/work/project_name/sources 2>&1
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/local/bin/bzr", line 21, in <module>
import os
File "/usr/local/lib/python2.5/os.py", line 44, in <module>
from posix import *
ImportError: from-import-* object has no __dict__ and no __all__
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe MyModel do
before do
MyModel.create!(:name => 'foo')
end
it 'this passes' do
MyModel.should be_exist(:name => 'foo')
end
it 'this also passes' do
<?php
$arr = array(
'members' => array(
'someQuestion',
'q2',
'lastThing'
)
);
<?php
$arr = array(
'members' => array(
'someQuestion',
'q2',
'lastThing'
)
);
cache.store(:key) { ExpensiveOperation.all } # lazy: pay cost on get
cache.store!(:key) { ExpensiveOperation.all } # pay cost now
# ---- OR ----
cache.store(:key) { ExpensiveOperation.all } # pay cost now
cache.lazy_store(:key) { ExpensiveOperation.all } # lazy: pay cost on get