Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to add missing dependency to run generator spec individually #962

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

tricknotes
Copy link
Contributor

@tricknotes tricknotes commented Oct 21, 2017

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

This change is Reviewable

@justin808
Copy link
Member

@robwise are you OK with this one? I really don't understand this change, given that tests were passing. Maybe without this fix, we can't run tests outside of the rake tasks. Any more info @tricknotes?


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@robwise
Copy link
Contributor

robwise commented Oct 22, 2017

I think what this is, is if you run the test quoted above individually (as opposed to as part of a suite), it fails because it has a dependency that loads when run as part of a suite, but not when run individually. Then this PR makes that dependency explicit?

@tricknotes
Copy link
Contributor Author

Thanks, @robwise !
It is completely what I want to say.

@justin808
Copy link
Member

@tricknotes Can you please add an entry to the CHANGELOG.md and I'll merge.


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@tricknotes tricknotes changed the title Add missing dependency to run spec separately Add missing dependency to run generator spec individually Oct 25, 2017
@tricknotes tricknotes changed the title Add missing dependency to run generator spec individually Fix to add missing dependency to run generator spec individually Oct 25, 2017
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
@tricknotes tricknotes force-pushed the fix-generator_messages_spec branch from e47c435 to f0aecf3 Compare October 25, 2017 17:25
@tricknotes
Copy link
Contributor Author

Thanks for your review, @justin808
I added an entry to the CHANGELOG.md and updated this PR.

@justin808 justin808 merged commit 991b50a into shakacode:master Oct 25, 2017
@justin808
Copy link
Member

Thanks @tricknotes! Merged!

@tricknotes tricknotes deleted the fix-generator_messages_spec branch October 26, 2017 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants