botspec 0.4.17 → 0.4.18
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/botspec/version.rb +1 -1
- data/lib/load_dialogs.rb +12 -20
- data/lib/rspec/botspec_runner.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: 85e0ea2d3a144338010391842e7348f71b6087eb
|
4
|
+
data.tar.gz: 25df82d943b4e10f34ac95155846c8e36caefe6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d7c15d57cbb9264bfd6547b84a58d676c7a287fc32884fd2adcb87135fc1fe7afc01f76e51b555d901c950444625bbf822883572485bcc7917aa2b266eb33e
|
7
|
+
data.tar.gz: af4e24ee64c64ea7c7a5ea4cdb029679d97657d7f8a5ced28e142849b360455dcbbc1e68789b574b9af9c82ab7da30a5046594e9769e47aea5d9299311223b07
|
data/lib/botspec/version.rb
CHANGED
data/lib/load_dialogs.rb
CHANGED
@@ -16,8 +16,6 @@ class LoadDialogs
|
|
16
16
|
dialog_yamls.collect{ |dialog_content|
|
17
17
|
dialog_content[:dialogs].collect{ |dialog|
|
18
18
|
Dialog.new({describe: dialog_content[:description], name: dialog[:what], interactions: dialog[:dialog], file: dialog_content[:file]})
|
19
|
-
}.each{ |dialog|
|
20
|
-
dialog.create_example_group
|
21
19
|
}
|
22
20
|
}.flatten
|
23
21
|
end
|
@@ -45,29 +43,23 @@ class Dialog
|
|
45
43
|
@lex_chat ||= BotSpec::AWS::LexService.new({botname: LoadDialogs.botname})
|
46
44
|
end
|
47
45
|
|
48
|
-
def
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
def examples
|
53
|
-
@examples
|
54
|
-
end
|
55
|
-
|
56
|
-
def create_example(interactions, examples=[])
|
57
|
-
return if interactions.size == 0
|
46
|
+
def create_example()
|
47
|
+
return if @interactions.size == 0
|
48
|
+
interactions = @interactions
|
58
49
|
|
59
50
|
@@lex_chat = lex_chat()
|
60
|
-
|
51
|
+
::RSpec.describe "#{@describe} #{@name}" do
|
52
|
+
|
53
|
+
it @name do
|
54
|
+
while interactions.size > 1 do
|
55
|
+
resp = @@lex_chat.post_message(interactions[0])
|
56
|
+
expect(resp[:message]).to match(interactions[1])
|
57
|
+
interactions = interactions.drop(2)
|
58
|
+
end
|
61
59
|
|
62
|
-
|
63
|
-
it interactions[0] do
|
64
|
-
expect(resp[:message]).to match(interactions[1])
|
60
|
+
resp = @@lex_chat.post_message(interactions[0]) if interactions.size == 1
|
65
61
|
end
|
66
62
|
end
|
67
63
|
|
68
|
-
examples << spec
|
69
|
-
create_example(interactions.drop(2), examples)
|
70
|
-
|
71
|
-
examples
|
72
64
|
end
|
73
65
|
end
|
data/lib/rspec/botspec_runner.rb
CHANGED
@@ -29,7 +29,7 @@ module BotSpec
|
|
29
29
|
return @configuration.reporter.exit_early(@configuration.failure_exit_code) if RSpec.world.wants_to_quit
|
30
30
|
dialogs_path = args[:dialogs_path]
|
31
31
|
|
32
|
-
run_specs(LoadDialogs.run_dialogs(botname, dialogs_path).map{|dialog| dialog.
|
32
|
+
run_specs(LoadDialogs.run_dialogs(botname, dialogs_path).map{|dialog| dialog.create_example}).tap do
|
33
33
|
persist_example_statuses
|
34
34
|
end
|
35
35
|
end
|