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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d75983bc7d9b2d8f9d41c3d687cd4b438bcaea0e
4
- data.tar.gz: e2fd4b39ec5a26826d83dc4ce8d2aedbc03116c2
3
+ metadata.gz: 35cba8169002badd58d9674449a6951bf5f7f3f3
4
+ data.tar.gz: e2f5b740459014d3a074a5830ca96364073e3ccc
5
5
  SHA512:
6
- metadata.gz: ca8a57cd349f36363090551a3adbbccc49dc32e9fa0f3c2c17b2d8fc3755291598ec963f106c427450290b7988678456e020ce935ab4b3881876443f65db55fd
7
- data.tar.gz: d88d1fae6b62eb37defba657dc6c9d08104ad050e8af74c2484981f7436b9ce2965b0f160acfbe5711737a62c0d0ce6fa09efd20f08d2a509f2d9d3f67d606e2
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
- /^DocDB\.describe[\(\s+]example,\s+(?<model>.*)[\)\s+]do/ =~ expectation_source
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Focinfi