rspec_fixtures 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rspec_fixtures/approval_handler.rb +19 -11
- data/lib/rspec_fixtures/version.rb +1 -1
- data/lib/rspec_fixtures.rb +0 -1
- metadata +1 -2
- data/lib/rspec_fixtures/colors.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e49a8b56073fea93986bf29232749c67b38829
|
4
|
+
data.tar.gz: 1c0ea45ca68abb68a2ec175126a653bfef4c60a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8248836925da316b8d0b53ba373df1a6ed386e5ccacd148cad704f0f52ffcebeda06d68d2496751287ce48c17561d4b14f3693f808ff7d88db36b2233a47669f
|
7
|
+
data.tar.gz: 0a140920b64dcbff8c8dfdc23fe787ccd9e878db2d8cf8dd8766ce9107d0cf6889d38208b8e99918fecee1d237f83185217848edd0bbfd42b8fcaf40eac0df21
|
data/README.md
CHANGED
@@ -1,31 +1,39 @@
|
|
1
|
+
require 'colsole'
|
2
|
+
|
1
3
|
module RSpecFixtures
|
2
4
|
class ApprovalHandler
|
3
|
-
include
|
5
|
+
include Colsole
|
4
6
|
|
5
7
|
def run(expected, actual, fixture_file)
|
6
|
-
|
8
|
+
line = '_' * terminal_width
|
9
|
+
|
10
|
+
say "!txtgrn!#{line}"
|
7
11
|
if expected.empty?
|
8
|
-
|
12
|
+
say actual
|
9
13
|
else
|
10
|
-
|
11
|
-
|
14
|
+
say "> New (Actual):"
|
15
|
+
say actual
|
16
|
+
say "!txtpur!#{line}"
|
17
|
+
say "> Old (Fixture):"
|
18
|
+
say expected
|
12
19
|
end
|
13
|
-
|
20
|
+
say "!txtgrn!#{line}"
|
21
|
+
say "> Approve new fixture? (y/N): "
|
14
22
|
|
15
|
-
if
|
16
|
-
|
23
|
+
if user_approves?
|
24
|
+
say "!txtgrn!Approved"
|
17
25
|
File.write fixture_file, actual
|
18
26
|
true
|
19
27
|
else
|
20
|
-
|
28
|
+
say "!txtred!Not Approved"
|
21
29
|
false
|
22
30
|
end
|
23
31
|
end
|
24
32
|
|
25
33
|
private
|
26
34
|
|
27
|
-
def
|
28
|
-
$stdin.getch
|
35
|
+
def user_approves?
|
36
|
+
$stdin.getch == 'y'
|
29
37
|
end
|
30
38
|
end
|
31
39
|
end
|
data/lib/rspec_fixtures.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_fixtures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
@@ -103,7 +103,6 @@ files:
|
|
103
103
|
- README.md
|
104
104
|
- lib/rspec_fixtures.rb
|
105
105
|
- lib/rspec_fixtures/approval_handler.rb
|
106
|
-
- lib/rspec_fixtures/colors.rb
|
107
106
|
- lib/rspec_fixtures/matchers/base.rb
|
108
107
|
- lib/rspec_fixtures/matchers/match_fixture.rb
|
109
108
|
- lib/rspec_fixtures/matchers/output_fixture.rb
|