1

私は現在、typheous と hyrda を使用しながら投稿リクエストを行おうとしています。応答をテストするために VCR gem を使用しています。

現在、次のエラーが発生しています: ArgumentError: comparison of Array with Array failed この行を実行すると: hydra.run

私のリクエストは次のとおりです。

<Typhoeus::Request:0x007fb7523a8688 @base_url="http://dev.moodle.co.za/webservice/rest/server.php?", @original_options={:method=>:get, :params=>{:wstoken=>"7d7ed6cc23c8143e4baaa39b51", :moodlewsrestformat=>"json", :wsfunction=>"enrol_manual_enrol_users ", :enrolments=>{"0"=>{:roleid=>5, :userid=>61, :courseid=>96}}}, :headers=>{:Accept=>"json"}}, @options={:method=>:get, :params=>{:wstoken=>"7d7ed6cc23c8143e4baaa39b515b10af", :moodlewsrestformat=>"json", :wsfunction=>"enrol_manual_enrol_users ", :enrolments=>{"0"=>{:roleid=>5, :userid=>61, :courseid=>96}}}, :headers=>{"User-Agent"=>"Typhoeus - https://github.com/typhoeus/typhoeus", :Accept=>"json"}, :maxredirs=>50}>

ユーザーIDとコースIDを削除すると正常に動作しますが、[0]に複数の配列メンバーがあるとすぐに上記のエラーが発生します。

また、VCR gem を削除すると正常に動作します。

これを解決する方法についてのアドバイス

Failure/Error: expect(person.moodle_create_user()).to eq(["id"=>"5nasCrYKc5", "username"=>"testing_moodle_gem"])
     ArgumentError:
       comparison of Array with Array failed
     # ./lib/moodle/request.rb:31:in `run_request'
     # ./lib/moodle/request.rb:14:in `execute_request'
     # ./lib/moodle/request.rb:19:in `execute_and_return_response_body'
     # ./lib/moodle/person.rb:11:in `moodle_create_user'
     # ./spec/moodle/person_spec.rb:30:in `block (4 levels) in <top (required)>'
     # ./spec/moodle/person_spec.rb:29:in `block (3 levels) in <top (required)>'
4

0 に答える 0