lopata 0.0.7 → 0.0.8
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 +4 -4
- data/lib/lopata/config.rb +7 -0
- data/lib/lopata/rspec/ar_dsl.rb +38 -0
- data/lib/lopata/rspec/formatter.rb +3 -2
- data/lib/lopata/rspec/version.rb +1 -1
- data/lib/lopata/runner.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcaa837beab28f6b3a0f5659539bd9779e7e029d
|
4
|
+
data.tar.gz: c2e6882d56da903a83e6ae84c812725d0fac5b53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d10d3e4149c28bd794b7d68f52f7f0760680294fd09033b5d0dd050eb48dc5d476e0c291616423a3456671f53bfdd957824b60b9430f73352a77930b7f5ee3e1
|
7
|
+
data.tar.gz: 3496b8a1fdca826dbaad3377c71a1aee76effcd9a7e94138931433604a9fe306b71be9958259827b123f2acec5e78b5c5d23eb29d65704c6e6a43fdaa6a6a73f
|
data/lib/lopata/config.rb
CHANGED
@@ -32,6 +32,13 @@ module Lopata
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
def init_active_record
|
36
|
+
require 'lopata/rspec/ar_dsl'
|
37
|
+
::RSpec.configure do |c|
|
38
|
+
c.include Lopata::RSpec::AR::DSL
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
35
42
|
def init_lopata_logging(build)
|
36
43
|
self.build_number = build
|
37
44
|
::RSpec.configure do |c|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Lopata
|
2
|
+
module RSpec
|
3
|
+
module AR
|
4
|
+
module DSL
|
5
|
+
def self.included(base)
|
6
|
+
base.extend(ClassMethods)
|
7
|
+
end
|
8
|
+
|
9
|
+
def cleanup(*objects)
|
10
|
+
return if Lopata::Config.ops[:keep]
|
11
|
+
objects.flatten.compact.each do |o|
|
12
|
+
begin
|
13
|
+
o.reload.destroy!
|
14
|
+
rescue ActiveRecord::RecordNotFound
|
15
|
+
# Already destroyed
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def reload(*objects)
|
21
|
+
objects.flatten.each(&:reload)
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
module ClassMethods
|
26
|
+
def cleanup(*vars, &block)
|
27
|
+
unless vars.empty?
|
28
|
+
teardown do
|
29
|
+
cleanup vars.map { |v| instance_variable_get "@#{v}" }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
teardown &block if block_given?
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -20,7 +20,8 @@ module Lopata
|
|
20
20
|
|
21
21
|
def example_failed(notification)
|
22
22
|
example = notification.example
|
23
|
-
|
23
|
+
backtrace = backtrace_for(notification)
|
24
|
+
@client.add_attempt(example, Lopata::FAILED, error_message_for(example), backtrace)
|
24
25
|
end
|
25
26
|
|
26
27
|
def example_pending(notification)
|
@@ -41,7 +42,7 @@ module Lopata
|
|
41
42
|
def backtrace_for(notification)
|
42
43
|
example = notification.example
|
43
44
|
exception = example.execution_result.exception
|
44
|
-
msg = notification.
|
45
|
+
msg = notification.formatted_backtrace.map(&:strip).join("\n")
|
45
46
|
msg << "\n"
|
46
47
|
if shared_group = find_shared_group(example)
|
47
48
|
msg << "# Shared Example Group: \"#{shared_group.metadata[:shared_group_name]}\" called from "
|
data/lib/lopata/rspec/version.rb
CHANGED
data/lib/lopata/runner.rb
CHANGED
@@ -11,6 +11,7 @@ module Lopata
|
|
11
11
|
option :rerun, type: :boolean, aliases: 'r'
|
12
12
|
option :users, type: :array, aliases: 'u'
|
13
13
|
option :build, aliases: 'b'
|
14
|
+
option :keep, type: :boolean, aliases: 'k'
|
14
15
|
def test
|
15
16
|
require 'rspec'
|
16
17
|
|
@@ -22,6 +23,7 @@ module Lopata
|
|
22
23
|
users: options[:users],
|
23
24
|
build: options[:build],
|
24
25
|
env: options[:env],
|
26
|
+
keep: options[:keep]
|
25
27
|
}
|
26
28
|
Lopata::Config.init(options[:env])
|
27
29
|
Lopata::Config.initialize_test
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lopata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Volochnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/lopata/generators/templates/config/environments/qa.yml
|
58
58
|
- lib/lopata/generators/templates/config/initializers/capybara.rb
|
59
59
|
- lib/lopata/id.rb
|
60
|
+
- lib/lopata/rspec/ar_dsl.rb
|
60
61
|
- lib/lopata/rspec/dsl.rb
|
61
62
|
- lib/lopata/rspec/formatter.rb
|
62
63
|
- lib/lopata/rspec/role.rb
|
@@ -85,5 +86,5 @@ rubyforge_project:
|
|
85
86
|
rubygems_version: 2.2.5
|
86
87
|
signing_key:
|
87
88
|
specification_version: 4
|
88
|
-
summary: lopata-0.0.
|
89
|
+
summary: lopata-0.0.8
|
89
90
|
test_files: []
|