Mock a static method on MyClass:
allow(MyClass).to receive(:my_method).with(1, 2, kind_of(Object)) { 'SOUNDS GOOD' }
To fail if it doesn't get called, use expect
instead of allow
To mock a method on any instances of MyClass:
Mock a static method on MyClass:
allow(MyClass).to receive(:my_method).with(1, 2, kind_of(Object)) { 'SOUNDS GOOD' }
To fail if it doesn't get called, use expect
instead of allow
To mock a method on any instances of MyClass:
class GuzzleResponseStub | |
{ | |
public function isSuccessful() | |
{ | |
return true; | |
} | |
public function json() | |
{ |
https://help.ubuntu.com/13.10/installation-guide/i386/apbs02.html
Boot options (when booting the CD/USB/netboot installation media):
... preseed/url=http://github.com/porty/pxe-things/???.seed
<html> | |
<head> | |
<style> | |
body { | |
background-size: contain; | |
background-repeat: no-repeat; | |
background-position: center; | |
} | |
</style> | |
<script> |
#!/bin/bash | |
# | |
# Ubuntu core filesystem makerer | |
# | |
# http://www.omappedia.com/wiki/OMAP_Ubuntu_Core | |
# | |
set -e |
For example, a good interface will pop up a "search" box for finding a security group in Active Directory. A bad one will let me chose security groups from a list or a drop-down. Both look equally good when the developer is working in a test environment. The latter will crash when used in a million-object directory. Similarly, check out the DNS management dialog box in Windows, or some Oracle tools. Both will show you "all" objects up to some limit (e.g.: 5000), but then provide a filter option to allow you to narrow down the "search" to prevent the GUI from melting if you look at a database with 500K tables. Yes. It happens. A lot. More than you think. Really.
It's 2014 for Christ's sake! There is absolutely no reason not to include a general "note" or at least a "description" field with every. Single. Thing. Seriously. All of them. I'm not kidding. Look at VMware's vSphere interface as an example of this done reasonably well but not perfectly. They at least allow custom colu
cd ~/Projects/raspberry-screens
# white
`which pip`/../python ./local_screens.py set pi-east-north "http://10.99.1.77/show_image.html?color=white&img=http://i.imgur.com/X6XR7HE.jpg"
# black
# tail the apache logs without other cruft | |
alias log1="tail -f /var/log/apache2/error.log | egrep -v --line-buffered '(CSRF|Load existing customer|rotatelogs|Could not open log file)'" | |
# tail contests logs | |
alias log2="sudo supervisorctl tail -f contests-worker-dev" | |
# tail commerce logs | |
alias log3="sudo supervisorctl tail -f commerce-worker-dev" | |
# start the things that didn't start automatically |