approvals 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/lib/approvals.rb CHANGED
@@ -15,6 +15,11 @@ module Approvals
15
15
  extend DSL
16
16
 
17
17
  class << self
18
+
19
+ def project_dir
20
+ @project_dir ||= FileUtils.pwd
21
+ end
22
+
18
23
  def reset
19
24
  Dotfile.reset
20
25
  end
@@ -52,7 +52,7 @@ module Approvals
52
52
  end
53
53
 
54
54
  def received_matches?
55
- IO.read(received_path) == ERB.new(IO.read(approved_path)).result
55
+ IO.read(received_path).chomp == ERB.new(IO.read(approved_path).chomp).result
56
56
  end
57
57
 
58
58
  def fail_with(message)
@@ -9,7 +9,7 @@ module Approvals
9
9
  end
10
10
 
11
11
  def path
12
- '.approvals'
12
+ File.join(Approvals.project_dir, '.approvals')
13
13
  end
14
14
 
15
15
  def touch
@@ -1,3 +1,3 @@
1
1
  module Approvals
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
@@ -67,6 +67,12 @@ describe Approvals do
67
67
  Approvals.verify json, :format => :json, :namer => namer
68
68
  end
69
69
 
70
+
71
+ it "verifies json and is newline agnostic" do
72
+ json = '{"pet":{"species":"turtle","color":"green","name":"Anthony"}}'
73
+ Approvals.verify json, :format => :json, :namer => namer
74
+ end
75
+
70
76
  it "verifies an executable" do
71
77
  executable = Approvals::Executable.new('SELECT 1') do |command|
72
78
  puts "your slip is showing (#{command})"
@@ -0,0 +1,7 @@
1
+ {
2
+ "pet": {
3
+ "species": "turtle",
4
+ "color": "green",
5
+ "name": "Anthony"
6
+ }
7
+ }
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: approvals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Katrina Owen
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-05-30 00:00:00.000000000 Z
12
+ date: 2013-06-29 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rspec
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: json
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: thor
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: nokogiri
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ! '>='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ! '>='
67
76
  - !ruby/object:Gem::Version
@@ -131,6 +140,7 @@ files:
131
140
  - spec/fixtures/approvals/approvals_verifies_an_executable.approved.txt
132
141
  - spec/fixtures/approvals/approvals_verifies_html.approved.html
133
142
  - spec/fixtures/approvals/approvals_verifies_json.approved.json
143
+ - spec/fixtures/approvals/approvals_verifies_json_and_is_newline_agnostic.approved.json
134
144
  - spec/fixtures/approvals/approvals_verifies_xml.approved.xml
135
145
  - spec/fixtures/approvals/verifications_a_string.approved.txt
136
146
  - spec/fixtures/approvals/verifies_a_complex_object.approved.txt
@@ -168,26 +178,26 @@ files:
168
178
  - spec/utilities/system_command_spec.rb
169
179
  homepage: ''
170
180
  licenses: []
171
- metadata: {}
172
181
  post_install_message:
173
182
  rdoc_options: []
174
183
  require_paths:
175
184
  - lib
176
185
  required_ruby_version: !ruby/object:Gem::Requirement
186
+ none: false
177
187
  requirements:
178
188
  - - ! '>='
179
189
  - !ruby/object:Gem::Version
180
190
  version: '0'
181
191
  required_rubygems_version: !ruby/object:Gem::Requirement
192
+ none: false
182
193
  requirements:
183
194
  - - ! '>='
184
195
  - !ruby/object:Gem::Version
185
196
  version: '0'
186
197
  requirements: []
187
198
  rubyforge_project: approvals
188
- rubygems_version: 2.0.3
199
+ rubygems_version: 1.8.23
189
200
  signing_key:
190
- specification_version: 4
201
+ specification_version: 3
191
202
  summary: Approval Tests for Ruby
192
203
  test_files: []
193
- has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MGRlZTc3ZTE4MWFjZWIwZjBmNzMxODkzMzJjZWE3OTU4Zjk1ODg0NQ==
5
- data.tar.gz: !binary |-
6
- OGJiMzk0NGI4OGQ1NjdmY2Y5MzgzZTQ1N2I5YjNlODBjYzFhZGVjMA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OTE4MDIzYWVlMjBjOTc4MmY5YjE2ODQyODFiMTVmYmYzMmI2NjI3NjhlYWEw
10
- ZTliMjM0YzNlYmZiZTYyMjc4NmZkODU3ZjM3MWJiN2NkOTU5ZGFhZDgzNTI0
11
- MjZlM2ZiOGYzNmFmODUxOTQyODgyNjdmZjExMGU1NmFhY2M2MWQ=
12
- data.tar.gz: !binary |-
13
- NWUyZTE2MWY3NmZlYjdjZTAzM2QwY2EzMzQ2YmUyYzAxNGNiOWE5ZjAyMzYx
14
- N2M3NDMwYzA4NDY5ZjYxYjhlMzVjYjk5YzZmOTM2YjQ2OGMwYWVkMmNkYTNi
15
- NjUwZGRkNjMyNTFkN2RmZmZjYTRiOTI4YjI2NmEzNDkzMTAzMzM=