lib/lucid_client/test/connection.rb
# Given a tree structure of request paths under methods, eg.
#
#     root_path/post/admin/products.201.json
#     root_path/get/admin/products.json
#
# ... would stub POST '/admin/products.json' to respond with a status
# of 201 and the file contents and GET '/admin/products.json' with a
# status of 200 (default) and the file contents.
#
Given a tree structure of request paths under methods, eg.

would stub POST '/admin/products.json' to respond with a status
of 201 and the file contents and GET '/admin/products.json' with a
status of 200 (default) and the file contents.
Given a tree structure of request paths under methods eg . would stub POST ' / admin / products . json ' to respond with a status of 201 and the file contents and GET ' / admin / products . json ' with a status of 200 ( default ) and the file contents .
def stub_json_tree( root_path )
        root_path = Pathname.new( root_path )
        %w{ get post patch put delete }.each do |method|
          Dir.glob( root_path.join method, '**/*.json' ).each do |path|
            stub_json_file( method, path )
          end
        end
      end
def stub_json_tree ( root_path ) root_path = Pathname . new ( root_path ) %w{ get post patch put delete } . each do | method | Dir . glob ( root_path . join method , '**/*.json' ) . each do | path | stub_json_file ( method , path ) end end end
Given a tree structure of request paths under methods, eg.
Given a tree structure of request paths under methods eg .
root_path
<not_specific>