generator_spec
generator_spec copied to clipboard
Test Rails generators with RSpec
We require the temporary directory to be deleted by the spec. This directory thus should not conflict with an existing one. Fixes #33.
Hi, I am packaging generator_spec for debian and have hit a problem. As a part of packaging, the tests are automatically run. But, I got one failure while running the...
[I wrote a spec](https://github.com/zedtux/nobrainer/blob/features/migration-scripts/spec/lib/generators/migration_generator_spec.rb) for a [NoBrainer](https://github.com/nviennot/nobrainer/) generator. It passes on my local machine, but [it fails on Travis](https://travis-ci.com/github/zedtux/nobrainer/builds/202292456) with the following error: ``` NameError: uninitialized constant Rails::Generators::Base::Rails /home/travis/.rvm/gems/ruby-2.6.0/gems/railties-6.0.3.4/lib/rails/generators/base.rb:302:in `namespace'...
I'm trying to call another generator inside mine, the `destination_root` is set correctly for the tasks in my generator, but the tasks from other generators are trying to use the...
When I run a spec, I get the following warning: ``` specify { expect(object).to matcher } or this: it { is_expected.to matcher } RSpec expects the matcher to have a...
It should be a [`assert_no_migration`](https://api.rubyonrails.org/classes/Rails/Generators/Testing/Assertions.html#method-i-assert_no_migration) equivalent. I tried to add it on `lib/generator_spec/matches.rb` but, by my understanding of the way [`matches`](https://github.com/stevehodgkiss/generator_spec/blob/master/lib/generator_spec/matcher.rb#L91-L110) works with `@negative_tree`, it needs access to `migration_file_name` and...
Hi there! I had an idea for a feature that would be useful and wanted to ask if it's something you'd accept a PR for. I'm running some generator specs...
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: ``` ruby require 'rails_helper' require 'generator_spec'...