在Rspec中,raise_error和raise_exception对我不起作用

时间:2016-07-11 07:13:59

标签: ruby rspec

describe "The Original Method list_instances_of_with_resources_change" do  
    it  "Should execute successfully and return Array of Google::Apis::DnsV1::Change object" do  
    expect{subject_class::list_instances_of_with_resources_change("Dummy ID",custom_params)}.to raise_error       
   end  
end

我得到的错误。

2) Testing Change Resource :  The Original Method list_instances_of_with_resources_change Should execute successfully and return Array of Google::Apis::DnsV1::Change object
     Failure/Error: response = client.send("list_changes", project, managed_zone, max_results:max_results, page_token:page_token, sort_by:sort_by, sort_order:sort_order)

     Google::Apis::ClientError:
       invalid: Invalid value for project: graphite-development1
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/http_command.rb:211:in `check_status'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/api_command.rb:102:in `check_status'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/http_command.rb:179:in `process_response'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/http_command.rb:286:in `execute_once'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/http_command.rb:107:in `block (2 levels) in execute'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:54:in `block in retriable'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `times'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `retriable'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/http_command.rb:104:in `block in execute'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:54:in `block in retriable'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `times'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/retriable-2.1.0/lib/retriable.rb:48:in `retriable'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/http_command.rb:96:in `execute'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/lib/google/apis/core/base_service.rb:345:in `execute_or_queue_command'
     # /home/vivekkumarmishra17/.rvm/gems/ruby-2.3.0/gems/google-api-client-0.9.4/generated/google/apis/dns_v1/service.rb:191:in `list_changes'
     # ./lib/puppet_x/puppetlabs/google_cloud_dns/provider.rb:165:in `list_instances_of_change'
     # ./spec/unit/neg_google_cloud_dns_change_spec.rb:24:in `block (2 levels) in <top (required)>'

0 个答案:

没有答案