Skip to content

Instantly share code, notes, and snippets.

@ordinaryzelig
Last active October 13, 2015 16:18
Show Gist options
  • Save ordinaryzelig/4222682 to your computer and use it in GitHub Desktop.
Save ordinaryzelig/4222682 to your computer and use it in GitHub Desktop.

I just released a gem called minispec-metadata which allows you to add metadata to specs similar to RSpec. It can be useful to use with Capybara so you can easily switch drivers on a per-spec basis.

describe 'Usage', some: 'metadata' do

  before do
    # Example usefulness:
    # Capybara.current_driver = metadata[:driver]
  end

  it 'defines a metadata method', more: 'metadata' do
    metadata.must_equal(
      some: 'metadata',
      more: 'metadata',
    )
  end

  it 'gives priority to closest metadata', some: 'different metadata' do
    metadata.must_equal(
      some: 'different metadata',
    )
  end

end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment