Skip to content

Instantly share code, notes, and snippets.

@cyx
Created February 24, 2010 08:55
Show Gist options
  • Save cyx/313258 to your computer and use it in GitHub Desktop.
Save cyx/313258 to your computer and use it in GitHub Desktop.
module Sinefunc
module SpecHelpers
module Sugar
def its(attribute, &block)
describe(attribute) do
define_method(:subject) { super().send(attribute) }
it(&block)
end
end
end
end
end
end
Rspec.configure { |c| c.extend Sinefunc::SpecHelpers::Sugar }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment