razum2um / lurker

📖 The ultimate tool for documenting and testing APIs in Rails
https://lurker.razum2um.me/lurker
MIT License
116 stars 22 forks source link

cannot load such file -- lurker/spec_helper #95

Closed edwardloveall closed 9 years ago

edwardloveall commented 9 years ago

Jumping off your advice in #94

I got this error:

/Users/user/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- lurker/spec_helper (LoadError)
  from /Users/user/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /Users/user/Code/rails/kms-humon/spec/spec_helper.rb:1:in `<top (required)>'
  from /Users/user/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /Users/user/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1025:in `block in requires='
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1025:in `each'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1025:in `requires='
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:101:in `block in process_options_into'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:100:in `each'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:100:in `process_options_into'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:22:in `configure'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:96:in `setup'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:85:in `run'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
  from /Users/user/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/exe/rspec:4:in `<top (required)>'
  from /Users/user/.gem/ruby/2.2.0/bin/rspec:23:in `load'
  from /Users/user/.gem/ruby/2.2.0/bin/rspec:23:in `<main>'

Here's the spec helper in question:

require 'lurker/spec_helper'
require 'webmock/rspec'

RSpec.configure do |config|
  config.expect_with :rspec do |expectations|
    expectations.syntax = :expect
  end

  config.mock_with :rspec do |mocks|
    mocks.syntax = :expect
  end

  config.order = :random
end

WebMock.disable_net_connect!(allow_localhost: true)
Strech commented 9 years ago

@edwardloveall please show your Gemfile and command you use to run specs

edwardloveall commented 9 years ago

I used rspec to run the tests. However, I can't reproduce this at the moment. I'm back to the Lurker::Spy::Forwardable error. In any case, here's my gemfile:

source 'https://rubygems.org'

ruby '2.2.0'

gem 'bourbon', '~> 3.2.1'
gem 'coffee-rails', '~> 4.1.0'
gem 'delayed_job_active_record'
gem 'email_validator'
gem 'flutie'
gem 'geocoder'
gem 'high_voltage'
gem 'i18n'
gem 'i18n-tasks', '~> 0.7.10'
gem 'jbuilder'
gem 'jquery-rails'
gem 'neat', '~> 1.5.1'
gem 'normalize-rails', '~> 3.0.0'
gem 'oj'
gem 'oj_mimic_json'
gem 'pg'
gem 'rack-timeout'
gem 'rails', '4.2.0'
gem 'recipient_interceptor'
gem 'refills'
gem 'sass-rails', '~> 5.0'
gem 'simple_form'
gem 'title'
gem 'uglifier'
gem 'unicorn'

group :development do
  gem 'binding_of_caller'
  gem 'foreman'
  gem 'spring'
  gem 'spring-commands-rspec'
  gem 'web-console'
end

group :development, :test do
  gem 'awesome_print'
  gem 'bundler-audit', require: false
  gem 'byebug'
  gem 'dotenv-rails'
  gem 'factory_girl_rails'
  gem 'pry-rails'
  gem 'rspec-rails', '~> 3.0.0'
end

group :test do
  gem 'capybara-webkit', '>= 1.2.0'
  gem 'database_cleaner'
  gem 'faker'
  gem 'formulaic'
  gem 'json-schema'
  gem 'launchy'
  gem 'lurker', github: 'razum2um/lurker'
  gem 'shoulda-matchers', require: false
  gem 'timecop'
  gem 'webmock'
end

group :staging, :production do
  gem 'airbrake'
  gem 'newrelic_rpm'
  gem 'rails_12factor'
end
Strech commented 9 years ago

@edwardloveall First of all please, move gem 'lurker', github: 'razum2um/lurker' outside test group (for future you could add group: [:test, :development] for it) and try again

Strech commented 9 years ago

@edwardloveall or just move it to group :development, :test do in Gemfile

edwardloveall commented 9 years ago

Moved it out, bundled, and ran rspec and got the same error. I also tried bundle exec rspec and got this error:

/Users/edwardloveall/.gem/ruby/2.2.0/bundler/gems/lurker-71a94483a3cd/lib/lurker/spec_helper/rails.rb:6:in `<module:Rails>': uninitialized constant Lurker::SpecHelper::Rails::ActiveSupport (NameError)
    from /Users/edwardloveall/.gem/ruby/2.2.0/bundler/gems/lurker-71a94483a3cd/lib/lurker/spec_helper/rails.rb:5:in `<module:SpecHelper>'
    from /Users/edwardloveall/.gem/ruby/2.2.0/bundler/gems/lurker-71a94483a3cd/lib/lurker/spec_helper/rails.rb:4:in `<module:Lurker>'
    from /Users/edwardloveall/.gem/ruby/2.2.0/bundler/gems/lurker-71a94483a3cd/lib/lurker/spec_helper/rails.rb:3:in `<top (required)>'
    from /Users/edwardloveall/.gem/ruby/2.2.0/bundler/gems/lurker-71a94483a3cd/lib/lurker/spec_helper.rb:1:in `require'
    from /Users/edwardloveall/.gem/ruby/2.2.0/bundler/gems/lurker-71a94483a3cd/lib/lurker/spec_helper.rb:1:in `<top (required)>'
    from /Users/edwardloveall/Code/rails/humon/spec/spec_helper.rb:1:in `require'
    from /Users/edwardloveall/Code/rails/humon/spec/spec_helper.rb:1:in `<top (required)>'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1025:in `require'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1025:in `block in requires='
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1025:in `each'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1025:in `requires='
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:101:in `block in process_options_into'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:100:in `each'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:100:in `process_options_into'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration_options.rb:22:in `configure'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:96:in `setup'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:85:in `run'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
    from /Users/edwardloveall/.gem/ruby/2.2.0/gems/rspec-core-3.0.4/exe/rspec:4:in `<top (required)>'
    from /Users/edwardloveall/.gem/ruby/2.2.0/bin/rspec:23:in `load'
    from /Users/edwardloveall/.gem/ruby/2.2.0/bin/rspec:23:in `<main>'
Strech commented 9 years ago

@edwardloveall So, i make some changes for you. Please try branch rails-4.2.

  1. Added some missed require
  2. Changed some scheme behavior (fields ordering in extensions.path_params)
  3. Fixed features

So travis say rails-4.2/ruby-2.2.0 is build successful

edwardloveall commented 9 years ago

That seemed to work when I ran bundle exec rspec or rake. Plain old rspec failed but that's fine. For what it's worth also, the /lurker route wasn't working. It lists it in the routes, but strangely with no http verb next to it.

Strech commented 9 years ago

@edwardloveall We decide to remove auto mounting /lurker route.

So, in version 0.6.7 you should manually mount lurker in your routes.rb. And i check than manual method is working.

I think 0.6.7 will be released at the end of this week.

Strech commented 9 years ago

@edwardloveall Hi there! We currently merge branch rails-4.2 into master, and make some fixes. Can you try new version of gem from master?

edwardloveall commented 9 years ago

Sure! Here's what happened:

So, no crash but no generated docs either. Also, I'm not sure how to mount lurker for my routes.

Strech commented 9 years ago

@edwardloveall Hi there! Do you still have problem with lurker?

edwardloveall commented 9 years ago

I believe so, yes. You mentioned manually mounting routes... Can you show me how to do that?

edwardloveall commented 9 years ago

Apologies, I think I had an old version from rubygems.org. Using the version from GitHub worked!

Strech commented 9 years ago

Yaw! Great news :sparkles:

Please make sure that you haven't bugs mentioned in this thread. If so, please close the issue or leave a comment and i close it.