golden_silk 0.0.2.pumpkin → 0.0.3.cardboard
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/golden_silk +1 -0
- data/lib/golden_silk/result/diff.rb +12 -14
- data/lib/golden_silk/result/no_effect.rb +10 -3
- data/lib/golden_silk/spinner.rb +9 -5
- data/lib/golden_silk/step/click.rb +2 -1
- data/lib/golden_silk/version.rb +1 -1
- 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: dae16601c21ac170ec594b547db698302e6d58f3
|
4
|
+
data.tar.gz: 5905ee2e8c0ad150ec94327571b701969bf1280e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3088cfb1e1119af61efae609d9d70d8d9d3b9b2d4cf00de6d118f14876f53011658087c54e1ff9f75c990adc4ee6f7ae8644a1f67b66f623b5a13ea9a491a1b5
|
7
|
+
data.tar.gz: 93c1e903ca9010115a7e90277811db631f68b0199a85e849ec10ae0ac63eeee81b6f221a635518f76b44dde1ee0ebbdb4b7c757eca8f5786ad0e302e2e4b68ca
|
data/bin/golden_silk
CHANGED
@@ -7,20 +7,18 @@ module GoldenSilk
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def to_s
|
10
|
-
s =
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
s
|
10
|
+
s = <<RSPEC
|
11
|
+
it 'has a particular effect' do
|
12
|
+
#{@steps[0...-1].join("\n sleep 2\n ")}
|
13
|
+
sleep 2
|
14
|
+
html_before = html
|
15
|
+
#{@steps.last}
|
16
|
+
sleep 2
|
17
|
+
html_after = html
|
18
|
+
diff = Diffy::Diff.new(html_before, html_after, context: 1).to_s
|
19
|
+
expect(diff).to eql('#{@diff.gsub("'", "\\\\'")}')
|
20
|
+
end
|
21
|
+
RSPEC
|
24
22
|
end
|
25
23
|
end
|
26
24
|
end
|
@@ -6,9 +6,16 @@ module GoldenSilk
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def to_s
|
9
|
-
s =
|
10
|
-
|
11
|
-
|
9
|
+
s = <<RSPEC
|
10
|
+
it 'has no effect' do
|
11
|
+
#{@steps[0...-1].join("\n sleep 2\n ")}
|
12
|
+
sleep 2
|
13
|
+
html_before = html
|
14
|
+
#{@steps.last}
|
15
|
+
sleep 2
|
16
|
+
expect(html).to eql(html_before)
|
17
|
+
end
|
18
|
+
RSPEC
|
12
19
|
end
|
13
20
|
end
|
14
21
|
end
|
data/lib/golden_silk/spinner.rb
CHANGED
@@ -38,10 +38,14 @@ module GoldenSilk
|
|
38
38
|
}
|
39
39
|
stuff(@queue, @results)
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
# TODO: configurable output dir, test file(s), preamble
|
42
|
+
# TODO: stream results so that all is not lost if you have to kill the generation
|
43
|
+
FileUtils.mkdir_p("test/integration")
|
44
|
+
File.open('test/integration/golden_silk_spec.rb', 'w') do |f|
|
45
|
+
f.puts "require 'diffy'"
|
46
|
+
f.puts "describe 'Golden Master behavior' do"
|
47
|
+
f.puts @results.join("\n")
|
48
|
+
f.puts "end"
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
@@ -65,7 +69,7 @@ module GoldenSilk
|
|
65
69
|
last_action.execute
|
66
70
|
sleep 2
|
67
71
|
after_snapshot = html
|
68
|
-
diff = Diffy::Diff.new(before_snapshot, after_snapshot).to_s
|
72
|
+
diff = Diffy::Diff.new(before_snapshot, after_snapshot, context: 1).to_s
|
69
73
|
|
70
74
|
if diff.empty?
|
71
75
|
puts "No change, adding to results but not queue."
|
data/lib/golden_silk/version.rb
CHANGED