Module: Turnip::RSpec::Loader

Defined in:
lib/turnip/rspec.rb

Overview

This module hooks Turnip into RSpec by duck punching the load Kernel method. If the file is a feature file, we run Turnip instead!

Instance Method Summary collapse

Instance Method Details

#load(*a, &b) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/turnip/rspec.rb', line 13

def load(*a, &b)
  if a.first.end_with?('.feature')
    require_if_exists 'turnip_helper'
    require_if_exists 'spec_helper'

    Turnip::RSpec.run(a.first)
  else
    super
  end
end