Skip to content

Instantly share code, notes, and snippets.

Hack on github.com with Kyle Neath

At GitHub, they've set out to GitHub be the best place to share code with friends, co-workers, classmates, and complete strangers.

Already, over three million people use GitHub to build amazing things together.

But that isn't enough. Everyone should enjoy the benefits of Git and everyone should Fork everything.

It turns out GitHub needs your help. You can be GitHub's partner in crime to help Kneath out.

@thomas-holmes
thomas-holmes / expose_current_running_example_as_spec.feature
Created August 14, 2013 03:34
Feature of expose_current_running_example_as
Feature: expose_current_running_example_as
Use `config.expose_current_running_example_as` to create a new example group
method that provides accessing to the currently running example
Scenario: Use expose_current_running_example_as to expose currently running example as current_example
Given a file named "expose_current_running_example_as_spec.rb" with:
"""ruby
RSpec.configure do |c|
c.expose_current_running_example_as :current_example
class Company < ActiveRecord::Base
before_create :generate_api_token
attr_accessible :name, :owner, :owner_id
validates :name, presence: true, uniqueness: { case_sensitive: false }, :length => { :minimum => 5, :maximum => 40 }
validates :owner, presence: true
validates :owner_id, presence: true