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

(3.0.0.beta1) the be_versioned rspec matcher doesn't work under zeus #272

Closed
keithpitt opened this issue Sep 19, 2013 · 7 comments
Closed
Assignees
Milestone

Comments

@keithpitt
Copy link

$ rspec spec/models/payment_plan_spec.rb
.

Finished in 0.28264 seconds
1 example, 0 failures

Randomized with seed 2964

But when I try with zeus:

$ zeus rspec spec/models/payment_plan_spec.rb

Run options: exclude {:ci=>true}
F

Failures:

  1) PaymentPlan should be versioned
     Failure/Error: it { should be_versioned }
     NoMethodError:
       undefined method `versioned?' for #<PaymentPlan:0x007f8c5e972ce0>
     # ./spec/models/payment_plan_spec.rb:6:in `block (2 levels) in <top (required)>'
     # -e:1:in `<main>'

Finished in 0.41087 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/models/payment_plan_spec.rb:6 # PaymentPlan should be versioned

Randomized with seed 0

I've copied the matcher into spec/support/paper_trail.rb for now, but it's only a hack.

@batter
Copy link
Collaborator

batter commented Sep 19, 2013

I've never used Zeus before, don't know a ton about it, but this could be related to the fact that Zeus is not typically used as part of a project's bundle? Trying putting this line on your spec_helper.rb:

require 'paper_trail/frameworks/rspec'

Although ideally this would load by itself, I'll have to take a closer look at Zeus and see if I can figure out what needs to be done differently for Zeus.

@ghost ghost assigned batter Sep 19, 2013
@batter
Copy link
Collaborator

batter commented Sep 19, 2013

Have you tried using any other RSpec extensions with Zeus, like shoulda-matchers for instance?

@keithpitt
Copy link
Author

I was using shoulda-matchers, and was having the same problem.

@batter
Copy link
Collaborator

batter commented Sep 20, 2013

Sounds like it might be an issue with Zeus then? Also, did you try putting that line in your spec_helper.rb?

@batter
Copy link
Collaborator

batter commented Oct 2, 2013

@keithpitt - Just figured out a solution that works. I just pushed 39decb3, which should make the manual require of one of the framework helpers work on your test helper. I've added a section to the README that discusses how to use the test helpers with Zeus.

note: you'll need to clone down the master branch in order to use this syntax, so if you want to continue using the 3.0.0.beta1 release, you'll need to use this syntax for the time being:

# spec/spec_helper.rb

ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
load 'paper_trail/frameworks/rspec' # forces a reload even if the file was previously loaded before

@keithpitt
Copy link
Author

Thanks so much @batter! I'll check it out when I get to work :)

@felixbuenemann
Copy link

Note that the manual require is also required for spring or you get the same NoMethodError.

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

No branches or pull requests

3 participants