jayzes / cucumber-api-steps

Cucumber steps to easily test REST-based XML and JSON APIs

Repository from Github https://github.comjayzes/cucumber-api-stepsRepository from Github https://github.comjayzes/cucumber-api-steps

getting private method `present?' called for #<Cucumber::Ast::Table:0x000000038cac28> (NoMethodError)

unxusr opened this issue · comments

Scenario: Adding new poi in json format # ../add_new_poi/add_new_poi.feature:5
When I send a POST request to "my/api/url" with the following: # cucumber-api-steps-0.10/lib/cucumber/api_steps.rb:24
| name | tester |
| lat | 42.3444 |
| lng | 23.9940 |
private method present?' called for #<Cucumber::Ast::Table:0x000000038cac28> (NoMethodError) ../add_new_poi/add_new_poi.feature:7:inWhen I send a POST request to "my/api/url" with the following:'

What i missed here?

present? is part of ActiveSupport, if you're not using Rails, it's not in Object. I worked around by adding:

class Object
  def blank?
    respond_to?(:empty?) ? empty? : !self
  end

  def present?
    !blank?
  end
end

to env.rb