Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Adds a `shared` method to RSpec
Ruby
tree: 7034924ee6

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.rvmrc
Gemfile
README.md
Rakefile
rspec-shared.gemspec

README.md

rspec-shared

This gem adds a shared method to RSpec Core which basically a let that is shared across examples.

Synopsis

describe do
  @@one = 1

  def shared_value
    @@one = @@one.next
  end

  shared(:foo) { shared_value }

  example { foo.should eq(2) }
  example { foo.should eq(2) }

  describe do
    example { foo.should eq(2) }
  end
end
Something went wrong with that request. Please try again.