rspec-doc 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rspec-doc/active_record.rb +4 -2
- data/lib/rspec-doc/rest_client.rb +5 -5
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 35cba8169002badd58d9674449a6951bf5f7f3f3
         | 
| 4 | 
            +
              data.tar.gz: e2f5b740459014d3a074a5830ca96364073e3ccc
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: cb32722062cf1a1adbdf1494ce533bfc769592696cfb4b5ca85516872d80403f658873a31ed3373b7d3c39d5ddc2b4f670acf65ef8b62bb532e0ee7ac97c8183
         | 
| 7 | 
            +
              data.tar.gz: c390c8a716d5b0c2fe90d9a1694215b48eba2c80b40ccc66b8e461f16a39ed1fdba158be057b49dc37ab94f8cff1e3189af4e87dbe290c95795cc2aa01709bf0
         | 
| @@ -1,4 +1,6 @@ | |
| 1 1 | 
             
            require 'active_record'
         | 
| 2 | 
            +
            require 'method_source'
         | 
| 3 | 
            +
             | 
| 2 4 | 
             
            require_relative 'markdown_util'
         | 
| 3 5 |  | 
| 4 6 | 
             
            module RSpecDoc::ActiveRecord  
         | 
| @@ -42,7 +44,7 @@ private | |
| 42 44 | 
             
              def self.make_db_assertion_md(expectation_source)
         | 
| 43 45 | 
             
                expectation_source = expectation_source.lstrip
         | 
| 44 46 | 
             
                # get the target obj name 
         | 
| 45 | 
            -
                 | 
| 47 | 
            +
                /\.describe[\(\s+]example,\s+(?<model>.*)[\)\s+]do/ =~ expectation_source
         | 
| 46 48 | 
             
                return nil unless model
         | 
| 47 49 |  | 
| 48 50 | 
             
                model.chomp!(')')    
         | 
| @@ -66,6 +68,6 @@ private | |
| 66 68 | 
             
                end
         | 
| 67 69 |  | 
| 68 70 | 
             
                # build markdown table 
         | 
| 69 | 
            -
                MarkdownUtil.table(['Column', 'Assertion', 'Value'], items)
         | 
| 71 | 
            +
                RSpecDoc::MarkdownUtil.table(['Column', 'Assertion', 'Value'], items)
         | 
| 70 72 | 
             
              end 
         | 
| 71 73 | 
             
            end
         | 
| @@ -35,26 +35,26 @@ private | |
| 35 35 |  | 
| 36 36 | 
             
                if params[:headers][:params]
         | 
| 37 37 | 
             
                  lines << "**Query String Parameters**" 
         | 
| 38 | 
            -
                  lines << MarkdownUtil.kv_table(params[:headers][:params])
         | 
| 38 | 
            +
                  lines << RSpecDoc::MarkdownUtil.kv_table(params[:headers][:params])
         | 
| 39 39 | 
             
                end
         | 
| 40 40 |  | 
| 41 41 | 
             
                params[:headers].delete(:params)
         | 
| 42 42 | 
             
                if params[:headers].size > 0
         | 
| 43 43 | 
             
                  lines << "**Request Headers**" 
         | 
| 44 | 
            -
                  lines << MarkdownUtil.http_headers_table(params[:headers])
         | 
| 44 | 
            +
                  lines << RSpecDoc::MarkdownUtil.http_headers_table(params[:headers])
         | 
| 45 45 | 
             
                end
         | 
| 46 46 |  | 
| 47 47 | 
             
                if params[:payload]
         | 
| 48 48 | 
             
                  lines << "**Request Body**" 
         | 
| 49 | 
            -
                  lines << MarkdownUtil.json_block(params[:payload])
         | 
| 49 | 
            +
                  lines << RSpecDoc::MarkdownUtil.json_block(params[:payload])
         | 
| 50 50 | 
             
                end
         | 
| 51 51 |  | 
| 52 52 | 
             
                lines << "**Response Headers**"
         | 
| 53 | 
            -
                lines << MarkdownUtil.http_headers_table(params[:response].headers)
         | 
| 53 | 
            +
                lines << RSpecDoc::MarkdownUtil.http_headers_table(params[:response].headers)
         | 
| 54 54 |  | 
| 55 55 | 
             
                if params[:response].headers[:content_type].to_s.include? 'json'
         | 
| 56 56 | 
             
                  lines << "**Response Body**"
         | 
| 57 | 
            -
                  lines << MarkdownUtil.json_block(params[:response].body)
         | 
| 57 | 
            +
                  lines << RSpecDoc::MarkdownUtil.json_block(params[:response].body)
         | 
| 58 58 | 
             
                end
         | 
| 59 59 |  | 
| 60 60 | 
             
                lines
         |