Skip to content

Instantly share code, notes, and snippets.

View geowy's full-sized avatar

George Wyatt geowy

  • Agworld
  • Perth, Western Australia
View GitHub Profile
@geowy
geowy / Rspec_subject_behaviour_question.rb
Last active February 10, 2016 03:20 — forked from damonjmurray/Rspec_subject_behaviour_question.rb
RSpec subject behaviour question
require 'spec_helper'
class Foo
def self.bar(first, second, third)
err_msg = '%s cannot be nil'
raise ArgumentError, err_msg % 'first' unless first
raise ArgumentError, err_msg % 'second' unless second
raise ArgumentError, err_msg % 'third' unless third
"#{first} #{second} #{third}"