stevehodgkiss / generator_spec

Test Rails generators with RSpec
MIT License
112 stars 22 forks source link

breaks be_* handlers #42

Open egh opened 9 years ago

egh commented 9 years ago

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.

SampsonCrowley commented 6 years ago

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