botspec 0.4.17 → 0.4.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12b873b1c9f840695e621ea2e6693232a4faff82
4
- data.tar.gz: c5eccb7238797f7c8ebddeaf2025f3860c38de40
3
+ metadata.gz: 85e0ea2d3a144338010391842e7348f71b6087eb
4
+ data.tar.gz: 25df82d943b4e10f34ac95155846c8e36caefe6c
5
5
  SHA512:
6
- metadata.gz: a4ce427e436aeeec794f9ba86670a378fd6a6d9d4fe76ec82e74d4268a6271cd920d87d140edcdb7891cec672b95e2a13d0da0a207518e192cb5e0e843beac87
7
- data.tar.gz: b1b21d18af52340d5aa1fdbdd3bd5dde8015a2bf12ec59635bb5f03f8896fe2b4886adc5438295b21c8e0a21343876ad7110ecd73ebc56436fb8396b8a0b7922
6
+ metadata.gz: a2d7c15d57cbb9264bfd6547b84a58d676c7a287fc32884fd2adcb87135fc1fe7afc01f76e51b555d901c950444625bbf822883572485bcc7917aa2b266eb33e
7
+ data.tar.gz: af4e24ee64c64ea7c7a5ea4cdb029679d97657d7f8a5ced28e142849b360455dcbbc1e68789b574b9af9c82ab7da30a5046594e9769e47aea5d9299311223b07
@@ -1,3 +1,3 @@
1
1
  module Botspec
2
- VERSION = "0.4.17"
2
+ VERSION = "0.4.18"
3
3
  end
@@ -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 create_example_group()
49
- @examples = create_example(@interactions).flatten
50
- end
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
- spec = ::RSpec.describe "#{@describe} #{@name}" do
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
- let(:resp) { @@lex_chat.post_message(interactions[0], 'user_id')}
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
@@ -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.examples}.flatten).tap do
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: botspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.17
4
+ version: 0.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliott Murray