Skip to content

Commit

Permalink
Fix to add missing dependency to run generator spec individually
Browse files Browse the repository at this point in the history
Without this `require` statement, the following error has thrown:

    $ bundle exec rspec spec/react_on_rails/generators/generator_messages_spec.rb
    An error occurred while loading ./spec/react_on_rails/generators/generator_messages_spec.rb.
    Failure/Error:
      describe GeneratorMessages do
        it "has an empty messages array" do
          expect(GeneratorMessages.messages).to be_empty
        end

        it "has a method that can add errors" do
          GeneratorMessages.add_error "Test error"
          expect(GeneratorMessages.messages)
            .to match_array([GeneratorMessages.format_error("Test error")])
        end

    NameError:
      uninitialized constant GeneratorMessages
    # ./spec/react_on_rails/generators/generator_messages_spec.rb:5:in `<top (required)>'
    No examples found.

    Finished in 0.00026 seconds (files took 0.12917 seconds to load)
    0 examples, 0 failures, 1 error occurred outside of examples
  • Loading branch information
tricknotes committed Oct 25, 2017
1 parent c1bce8f commit f0aecf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changes since last non-beta release.

#### Fixed
- Fixed `react_component_hash` functionality in cases of prerendering errors: [PR 960](https://github.com/shakacode/react_on_rails/pull/960) by [Judahmeek](https://github.com/Judahmeek)
- Fix to add missing dependency to run generator spec individually: [PR 962](https://github.com/shakacode/react_on_rails/pull/962) by [tricknotes](https://github.com/tricknotes)

*Please add entries here for your pull requests.*

Expand Down
2 changes: 1 addition & 1 deletion spec/react_on_rails/generators/generator_messages_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require_relative "../simplecov_helper"
require_relative "../support/generator_spec_helper"

describe GeneratorMessages do
it "has an empty messages array" do
Expand Down

0 comments on commit f0aecf3

Please sign in to comment.