zeus rspec fails include required files, but rspec alone does fine
Asked Answered
O

1

9

It's weird issue, zeus start running smoothly.

rspec spec/ does it's job flawless.

My spec_helper config is 
# encoding: UTF-8
require 'rubygems'

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'email_spec'
require 'rspec/autorun'
require 'capybara/rspec'
require 'shoulda-matchers'
require 'shoulda/matchers/integrations/rspec'

Dir["./spec/support/**/*.rb"].sort.each {|f| require f}

RSpec.configure do |config|

  config.include FactoryGirl::Syntax::Methods
  config.include Devise::TestHelpers, type: :controller
  config.include Capybara::DSL, type: :request


  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.mock_with :rspec
  config.use_transactional_fixtures = true
end

I have shared contexts in spec/support/shared_contexts.rb (which is normally included). rspec spec/ passed all tests, then zeus rspec spec/ passed all tests and throws inclusion errors like this

`find_and_eval_shared': Could not find shared context "with signed user" (ArgumentError)

It tries to pass zeus rspec spec/models and then throws 'factory_girl' inclusion errors while rspec spec/models do it's job fine.

It appears to look like this issue https://github.com/burke/zeus/issues/175

Operand answered 25/12, 2012 at 12:14 Comment(0)
O
20

I found this behavior was cause by

 require 'rspec/autotest'

in spec_helper.rb

Operand answered 2/1, 2013 at 19:24 Comment(3)
Commenting out require 'rspec/autorun' fixed the issue for me.Mccollum
Thanks a lot. Posted your solution to the github issue as well: github.com/burke/zeus/issues/134Loudhailer
likewise, I found with version rspec_rails 2.13.0, that I had to comment out a similar line in spec_helper: require 'rspec/autorun' in order to eliminate a complete meltdown of my specs.Finance

© 2022 - 2024 — McMap. All rights reserved.