How to test Chef::REST.run_request

In order to write a test for CHEF-269, I need to write a test for
Chef::REST.run_request. Unfortunately, this code is prefixed with

   # TODO - Figure out how to test this block - I really have no  

idea how
# to do it without actually calling http.request…

So, what is the best way to approach this?

/Jeppe

On 13/07/2009, at 10:57 PM, Jeppe Nejsum Madsen wrote:

In order to write a test for CHEF-269, I need to write a test for
Chef::REST.run_request. Unfortunately, this code is prefixed with

 # TODO - Figure out how to test this block - I really have no  

idea how
# to do it without actually calling http.request...

So, what is the best way to approach this?

Looks to be a legacy TODO - there are functioning tests for
#run_request:

Regards,

--
AJ Christensen, Software Engineer
Opscode, Inc.
E: aj@opscode.com

On 13/07/2009, at 13.00, Arjuna Christensen wrote:

On 13/07/2009, at 10:57 PM, Jeppe Nejsum Madsen wrote:

In order to write a test for CHEF-269, I need to write a test for
Chef::REST.run_request. Unfortunately, this code is prefixed with

 # TODO - Figure out how to test this block - I really have no  

idea how
# to do it without actually calling http.request...

So, what is the best way to approach this?

Looks to be a legacy TODO - there are functioning tests for
#run_request:

chef/chef/spec/unit/rest_spec.rb at 94b6530e69f3f50dcce11990a922ec7a5bd02706 · chef/chef · GitHub

Ahh thanks. So, I actually succeeded in creating a fix, complete with
spec and everything (not bad for a Java/Scala guy, eh :-).

If somebody want to do a sanity check: GitHub - jeppenejsum/chef: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.

/Jeppe