Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zymtx5g79k/d80b0d8bebd75978e4ec1f1421e38fb2 to your computer and use it in GitHub Desktop.
Save zymtx5g79k/d80b0d8bebd75978e4ec1f1421e38fb2 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
RSpec.configure do |rspec|
# This config option will be enabled by default on RSpec 4,
# but for reasons of backwards compatibility, you have to
# set it on RSpec 3.
#
# It causes the host group and examples to inherit metadata
# from the shared context.
rspec.shared_context_metadata_behavior = :apply_to_host_groups
end
RSpec.shared_context 'bonus_types_context', shared_context: :metadata do
before :all do
# @some_var = :some_value
create :bonus_type, :fast_bonus
create :bonus_type, :direct_bonus
create :bonus_type, :network_bonus
end
# def shared_method
# 'bonus_types method'
# end
# subject do
# 'bonus_types subject'
# end
end
RSpec.configure do |rspec|
rspec.include_context 'bonus_types_context', with_bonus_types: true
end
context 'nested_members', with_bonus_types: true do
it 'should be empty by default - only me'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment