Skip to content

Instantly share code, notes, and snippets.

@royosherove
royosherove / gist:2709023
Created May 16, 2012 09:22
Test Driven Validation Logic with Extract & Override
public class Dinner
{
public string Description { get; set; }
public string Title { get; set; }
public DateTime EventDate { get; set; }
public bool IsValid { get { return validate(); }}
private bool validate()
{
@royosherove
royosherove / gist:2272892
Created April 1, 2012 07:46
Isolator bug with Isolate.nonpublic.wascalled.witharguments
from my tdd class:
[TestFixture, Isolated]
public class LoginManagerWithStaticTestIsolator1
{
[Test]
public void IsLoginOK_LoggerThrowsException_CalledWebService()
{
LoginManagerWithFutureObject lm = new LoginManagerWithFutureObject();
@royosherove
royosherove / gist:1949777
Created March 1, 2012 13:22
my ohmyzsh theme
#!/usr/bin/env zsh
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
setopt promptsubst
autoload -U add-zsh-hook
PROMPT_SUCCESS_COLOR=$FG[117]
PROMPT_FAILURE_COLOR=$FG[124]
PROMPT_VCS_INFO_COLOR=$FG[242]
@royosherove
royosherove / rspecparams.rb
Created February 23, 2012 12:04
There's has to be a cleaner way to do this with rspec and ruby
[ ["1,2",3], ["1,3",4] ].each do |arr|
it "'s add method should return the sum of multiple numbers" do
StringCalc.new.add(arr[0]).should == arr[1]
end
end
using System;
namespace ChapterOneExample. Utilities
{
public class StringUtilities
{
public int CountOccurences(string stringToCheck,
string stringToFind)
{
Using gpgme (1.0.9) from https://github.com/mrsimo/ruby-gpgme.git (at master) with native extensions /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for gpgme-config... no
gpgme-config not found
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.