我正在尝试从我的 launch_steps.rb 文件中的自定义类内部调用 app_exec,但我不断收到此异常:
MyJSON:Class (NoMethodError) 的未定义方法“app_exec”
Then (/^I check the json/) do
MyJSON.requestJson
puts MyJSON.json
# If I put app_exec here, it will work fine
# app_exec( "getJsonMessages:", true )
end
class MyJSON
include Frank::Cucumber::FrankHelper
@json = nil
@flush = true;
def self.requestJson
@json=app_exec( "getJsonMessages:", true ) #undefined method even with the inclusion of FrankHelper
if @json.count==0
@json = nil
raise "No Data Returned From Application"
end
end
def self.json
@json
end
end