Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby Frank Cucumber:自定义类中的app_exec引发异常_Ruby_Cucumber_Frank - Fatal编程技术网

Ruby Frank Cucumber:自定义类中的app_exec引发异常

Ruby Frank Cucumber:自定义类中的app_exec引发异常,ruby,cucumber,frank,Ruby,Cucumber,Frank,我试图从launch_steps.rb文件中的自定义类中调用app_exec,但我一直遇到以下异常: MyJSON:Class(NoMethodError)的未定义方法“app\u exec” 问题在于,我包括而不是扩展: class MyJSON extend Frank::Cucumber::FrankHelper 我仍然不知道为什么我不能引用它而不扩展它。即使我尝试了以下方法,也不会奏效: class MyJSON include Frank::Cucumber::FrankHe

我试图从launch_steps.rb文件中的自定义类中调用app_exec,但我一直遇到以下异常:

MyJSON:Class(NoMethodError)的未定义方法“app\u exec”


问题在于,我包括而不是扩展:

class MyJSON
  extend Frank::Cucumber::FrankHelper
我仍然不知道为什么我不能引用它而不扩展它。即使我尝试了以下方法,也不会奏效:

class MyJSON
  include Frank::Cucumber::FrankHelper

  @json = nil
  @flush = true;

  def self.requestJson
    @json=Frank::Cucumber::FrankHelper.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
class MyJSON
  include Frank::Cucumber::FrankHelper

  @json = nil
  @flush = true;

  def self.requestJson
    @json=Frank::Cucumber::FrankHelper.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