generator_spec icon indicating copy to clipboard operation
generator_spec copied to clipboard

breaks be_* handlers

Open egh opened this issue 9 years ago • 1 comments

To reproduce, create a new rails 4.2.1 project, add rspec-rails and generator_spec to Gemfile, run rails generate rspec:install, then create the following generator test:

require 'rails_helper'
require 'generator_spec'

describe 'foo', type: :generator do
  it 'works' do
    expect([]).to be_empty
  end
end

This will fail:

1) foo works
     Failure/Error: expect([]).to be_empty
     NoMethodError:
       undefined method `be_empty' for #<#<Class:0x007ff272fac398>:0x007ff272fac2d0>
     # ./spec/generators/foo_spec.rb:6:in `block (2 levels) in <top (required)>'

But if we remove the type: :generator, it will work.

egh avatar May 19 '15 20:05 egh

@stevehodgkiss is there any news on this? the issue is 2 years old but latest commit was last year

SampsonCrowley avatar Jul 26 '18 01:07 SampsonCrowley