slacker 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/slacker +1 -1
- data/lib/slacker/application.rb +1 -1
- data/lib/slacker/command_line_formatter.rb +16 -14
- data/lib/slacker/version.rb +1 -1
- metadata +2 -3
- data/lib/slacker/command_line_formatter2.rb +0 -61
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmQ1YzM5YjRiZTEwMWQ3YjZhZjRkNjRiMmNiZTZmNTJjMzZjZTMxZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTY5NWUzNjlkOGZkZTJlMzM2YWFlOGJhYWZlMWY5ZmJmZDZjZjViMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yzc3ZmNiNDZhNzYwZTZlZjQ4ODE2Zjg0NTFhMjI1NGVmM2FiYjViZTgwOTY4
|
10
|
+
Yzc3YjI1NjFjYzJkODk3ZjEyY2JlYWZjMDVjOWNhYzY3OGRjODYxODQ2Y2Rj
|
11
|
+
MDI0OTNhOGVmYTAwYjFkOGMzMjA3YzUxYjI2ODJhODU0ZDBiYjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDIyNTg0OWE5NDY1YzhhNWIzYmY5MGNhY2U4NjE1YmZjMGRjMDYyZDNhMWI2
|
14
|
+
Nzg0N2NmNmM1YTMwMjEwNzYxOTkzYWZhZTM3YjU5MTZmOWFiY2FhNWE4ZWM1
|
15
|
+
YjMzY2MzNzQzOGYwMGIxMDJjZTBiYzM4YjA5NjIyNDczYTYzYmQ=
|
data/bin/slacker
CHANGED
data/lib/slacker/application.rb
CHANGED
@@ -4,6 +4,7 @@ require 'rspec/core/formatters/progress_formatter'
|
|
4
4
|
module Slacker
|
5
5
|
class CommandLineFormatter < RSpec::Core::Formatters::ProgressFormatter
|
6
6
|
include Slacker::Formatter
|
7
|
+
RSpec::Core::Formatters.register self, :example_passed, :example_failed
|
7
8
|
|
8
9
|
def initialize(output)
|
9
10
|
super(output)
|
@@ -11,46 +12,47 @@ module Slacker
|
|
11
12
|
@passed_examples_count = 0
|
12
13
|
end
|
13
14
|
|
14
|
-
def example_passed(
|
15
|
-
|
16
|
-
|
15
|
+
def example_passed(notification)
|
16
|
+
super(notification)
|
17
|
+
process_example_debug_output(notification, false)
|
17
18
|
end
|
18
19
|
|
19
|
-
def example_failed(
|
20
|
-
|
21
|
-
|
20
|
+
def example_failed(notification)
|
21
|
+
super(notification)
|
22
|
+
process_example_debug_output(notification, true)
|
22
23
|
end
|
23
24
|
|
24
25
|
private
|
25
26
|
|
26
|
-
def process_example_debug_output(
|
27
|
+
def process_example_debug_output(notification, example_failed)
|
27
28
|
if example_failed
|
28
29
|
@failed_examples_count += 1
|
29
|
-
debug_output(
|
30
|
+
debug_output(notification, Slacker.configuration.expand_path('debug/failed_examples'), @failed_examples_count, example_failed)
|
30
31
|
else
|
31
32
|
@passed_examples_count += 1
|
32
|
-
debug_output(
|
33
|
+
debug_output(notification, Slacker.configuration.expand_path('debug/passed_examples'), @passed_examples_count, example_failed)
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
|
-
def debug_output(
|
37
|
+
def debug_output(notification, out_folder, file_number, example_failed)
|
37
38
|
# Write out the SQL
|
38
39
|
File.open("#{out_folder}/example_#{'%03d' % file_number}.sql", 'w') do |out_file|
|
39
|
-
out_file.write(get_formatted_example_sql(
|
40
|
+
out_file.write(get_formatted_example_sql(notification, example_failed))
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
|
-
def get_formatted_example_sql(
|
44
|
+
def get_formatted_example_sql(notification, example_failed)
|
45
|
+
example = notification.example
|
44
46
|
sql = <<EOF
|
45
47
|
-- Example "#{example.metadata[:full_description]}"
|
46
48
|
-- #{example.metadata[:location]}
|
47
|
-
-- Executed at #{example.
|
49
|
+
-- Executed at #{example.execution_result.started_at}
|
48
50
|
|
49
51
|
#{example.metadata[:sql]}
|
50
52
|
|
51
53
|
-- SLACKER RESULTS
|
52
54
|
-- *******************************************
|
53
|
-
#{example_failed ? example_failure_text(
|
55
|
+
#{example_failed ? example_failure_text(notification).split("\n").collect{|line| '-- ' + line}.join("\n") : '-- Example Passed OK'}
|
54
56
|
-- *******************************************
|
55
57
|
EOF
|
56
58
|
sql.strip
|
data/lib/slacker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slacker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vassil Kovatchev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,7 +75,6 @@ files:
|
|
75
75
|
- lib/slacker.rb
|
76
76
|
- lib/slacker/application.rb
|
77
77
|
- lib/slacker/command_line_formatter.rb
|
78
|
-
- lib/slacker/command_line_formatter2.rb
|
79
78
|
- lib/slacker/configuration.rb
|
80
79
|
- lib/slacker/formatter.rb
|
81
80
|
- lib/slacker/query_result_matcher.rb
|
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'slacker/formatter'
|
2
|
-
require 'rspec/core/formatters/progress_formatter'
|
3
|
-
|
4
|
-
module Slacker
|
5
|
-
class CommandLineFormatter2 < RSpec::Core::Formatters::ProgressFormatter
|
6
|
-
include Slacker::Formatter
|
7
|
-
RSpec::Core::Formatters.register self, :example_passed, :example_failed
|
8
|
-
|
9
|
-
def initialize(output)
|
10
|
-
super(output)
|
11
|
-
@failed_examples_count = 0
|
12
|
-
@passed_examples_count = 0
|
13
|
-
end
|
14
|
-
|
15
|
-
def example_passed(notification)
|
16
|
-
super(notification)
|
17
|
-
process_example_debug_output(notification, false)
|
18
|
-
end
|
19
|
-
|
20
|
-
def example_failed(notification)
|
21
|
-
super(notification)
|
22
|
-
process_example_debug_output(notification, true)
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def process_example_debug_output(notification, example_failed)
|
28
|
-
if example_failed
|
29
|
-
@failed_examples_count += 1
|
30
|
-
debug_output(notification, Slacker.configuration.expand_path('debug/failed_examples'), @failed_examples_count, example_failed)
|
31
|
-
else
|
32
|
-
@passed_examples_count += 1
|
33
|
-
debug_output(notification, Slacker.configuration.expand_path('debug/passed_examples'), @passed_examples_count, example_failed)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def debug_output(notification, out_folder, file_number, example_failed)
|
38
|
-
# Write out the SQL
|
39
|
-
File.open("#{out_folder}/example_#{'%03d' % file_number}.sql", 'w') do |out_file|
|
40
|
-
out_file.write(get_formatted_example_sql(notification, example_failed))
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def get_formatted_example_sql(notification, example_failed)
|
45
|
-
example = notification.example
|
46
|
-
sql = <<EOF
|
47
|
-
-- Example "#{example.metadata[:full_description]}"
|
48
|
-
-- #{example.metadata[:location]}
|
49
|
-
-- Executed at #{example.execution_result.started_at}
|
50
|
-
|
51
|
-
#{example.metadata[:sql]}
|
52
|
-
|
53
|
-
-- SLACKER RESULTS
|
54
|
-
-- *******************************************
|
55
|
-
#{example_failed ? example_failure_text(notification).split("\n").collect{|line| '-- ' + line}.join("\n") : '-- Example Passed OK'}
|
56
|
-
-- *******************************************
|
57
|
-
EOF
|
58
|
-
sql.strip
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|