Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

NoMethodError: undefined method `each' for true:TrueClass #173

Open
IanWhitney opened this issue Feb 24, 2015 · 3 comments
Open

NoMethodError: undefined method `each' for true:TrueClass #173

IanWhitney opened this issue Feb 24, 2015 · 3 comments

Comments

@IanWhitney
Copy link

Just trying to get started with Pacto and I can't get it to load contracts. Here's what I've got:

My current Gemfile.lock: https://gist.github.com/IanWhitney/95c26ee672e6b44609f0#file-gemfile-lock
Ruby: 2.2.0-p0

I have a contracts directory in the top level of my app. I only have one contract in there, which came from your samples directory. I've tried both the get_album_cover.json and user.json contracts. I don't expect these contracts to be validated, I just want to see the contract validation run and fail.

I have added the require 'pacto/rake_task' line to my Rakefile.

I then spin up my Rails server so that it is running on port 3000

Then on the command line, I use

bundle exec rake pacto:validate[http://localhost:3000,contracts] --trace

And I get the following stack trace: https://gist.github.com/IanWhitney/95c26ee672e6b44609f0#file-stacktrace-sh

Thoughts?

I was getting the same response when I tried to load contracts in an Rspec test as well. I thought maybe the problem was there, but no. All my attempts to load contracts results in this error.

@ruprict
Copy link

ruprict commented Jul 21, 2015

I am seeing this same issue in Rspec, and I think it's due to the same thing mentioned in this issue. If you point your Gemfile to the master branch, it may help...it helped me.

@shadowbq
Copy link

+1 Pointing at master? What.. This is now 6 months old and release gem is still acting in this way with an extremely simple request.

@brunofracalossi
Copy link

I'm also facing this issue... it happens when I tries to use an schema in request that is an array... like the one below (if I remove minItems=1, it doesn't send the array and then error doesn't happen):

"type": "array",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "test",
"required":true,
"minItems": 1,

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

No branches or pull requests

4 participants