File: syntax.rb

package info (click to toggle)
ruby-bogus 0.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 860 kB
  • sloc: ruby: 4,219; makefile: 8; sh: 2
file content (23 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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