Sha256: c7988824f0529c954fa8f9e5d4618c20c4896482abef1a3f140c115e1f18aadb

Contents?: true

Size: 529 Bytes

Versions: 2

Compression:

Stored size: 529 Bytes

Contents

require 'forwardable'

module Bogus
  class RSpecSyntax
    extend Takes
    extend Forwardable
    takes :context
    def_delegators :context, :before, :after, :described_class

    def described_class=(value)
      # for new RSpec (> 3.0)
      context.metadata[:described_class] = value
      # for old RSpec (< 3.0)
      context.example.metadata[:example_group][:described_class] = value
    end

    def after_suite(&block)
      RSpec.configure do |config|
        config.after(:suite, &block)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bogus-0.1.7 lib/bogus/rspec/syntax.rb
bogus-0.1.6 lib/bogus/rspec/syntax.rb