rspec-hanami icon indicating copy to clipboard operation
rspec-hanami copied to clipboard

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

Open vladiim opened this issue 7 years ago • 5 comments

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?

vladiim avatar May 04 '17 10:05 vladiim

Hey, thanks for the report 👍

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

davydovanton avatar May 04 '17 11:05 davydovanton

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 avatar May 05 '17 23:05 vladiim

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?

vladiim avatar May 05 '17 23:05 vladiim

@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 ?

artofhuman avatar Oct 21 '17 11:10 artofhuman

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

davydovanton avatar Oct 21 '17 11:10 davydovanton