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

RSpec::Hanami::RequestHelpers doesn't exist? #9

Open
vladiim opened this issue May 4, 2017 · 5 comments
Open

RSpec::Hanami::RequestHelpers doesn't exist? #9

vladiim opened this issue May 4, 2017 · 5 comments
Labels

Comments

@vladiim
Copy link

vladiim commented May 4, 2017

After including RequestHelpers ala config.include RSpec::Hanami::RequestHelpers I get noMethodError: undefined method post'`

When reviewing the source code I can't see RSpec::Hanami::RequestHelpers anywhere. Am I missing something here?

@davydovanton
Copy link
Owner

Hey, thanks for the report 👍

Could you create empty hanami app and try to reproduce this error? Thanks!

@vladiim
Copy link
Author

vladiim commented May 5, 2017

Yes - I get the same error in a new Hanami app instance.

$ hanami new foo --test=rspec
$ cd foo
$ echo "gem 'rspec-hanami', group: :test" >> Gemfile
$ bundle
# spec/spec_helper.rb
require 'rspec/hanami'

RSpec.configure do |config|
  config.include RSpec::Hanami::Matchers
  config.include RSpec::Hanami::RequestHelpers
end
$ rspec

Output:

NameError: uninitialized constant RSpec::Hanami::RequestHelpers
  /Users/vlad/code/test/spec/spec_helper.rb:106:in `block in <top (required)>'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core.rb:98:in `configure'
  /Users/vlad/code/test/spec/spec_helper.rb:28:in `<top (required)>'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1453:in `require'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1453:in `block in requires='
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1453:in `each'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1453:in `requires='
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration_options.rb:112:in `block in process_options_into'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration_options.rb:111:in `each'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration_options.rb:111:in `process_options_into'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/configuration_options.rb:21:in `configure'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:99:in `setup'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:86:in `run'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:71:in `run'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:45:in `invoke'
  /Users/vlad/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rspec-core-3.6.0/exe/rspec:4:in `<top (required)>'
  /Users/vlad/.rbenv/versions/2.3.3/bin/rspec:22:in `load'
  /Users/vlad/.rbenv/versions/2.3.3/bin/rspec:22:in `<top (required)>'

@vladiim
Copy link
Author

vladiim commented May 5, 2017

bundle open 'rspec-hanami reveals that rspec-hanami/lib/rspec/hanami/request_helpers.rb is missing.

The rspec-hanami version is 0.2.0 and ruby --version is 2.3.3p222.

Hope that helps?

@artofhuman
Copy link

@vladiim It because RequestHelpers do not release yet.
I try to reproduce this bug and it reproduced in 0.2.0, but not in head gem 'rspec-hanami', group: :test, github: 'davydovanton/rspec-hanami'

@davydovanton mb this feature should be released in 0.3.0 ?

@davydovanton
Copy link
Owner

@artofhuman I think yes, 0.3.0 good place for this feature 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants