cucumber-formatter-dots 1.0.4 → 1.1.0

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
  SHA256:
3
- metadata.gz: 24e3295c66bb05ed7524d2ed1c1be64e39655c349d52e2d48e4aee8f363ce5f1
4
- data.tar.gz: b5f2ea361e9c801e1981cbb8ab51722d125214bcf0c20d603bf59cceee02aeaf
3
+ metadata.gz: 3a01785128135a72a372668ed75e8d563f9a1f1e5e64514f528f9612017bd367
4
+ data.tar.gz: c4b2e183db28eca17302249e5bcac7750d50a732f3273459e93ba69af7e19aee
5
5
  SHA512:
6
- metadata.gz: 441d7f59f3ded72ea29f3306a536a7fc3d791448853cb2624e664a80922dd75f9e00fd75991ba29b47124fc3009f3c1eeebe41205facbe217d5a2efead01b538
7
- data.tar.gz: 44ceda797aa923ddbe476a58d92afe5b672dfdfc2a982849d2c349d77b4bf4166b7e0bb52f4b93703e40b013d1c58d9d0b79a88d2b4f175149dbc730701c044b
6
+ metadata.gz: '038e9ef779fb69e9847ac7766c7f2b43f80635f15262fbadefbc11273c85ddb90439d8681a2b8439eaf4b511ab1938f321eb22a4eaacccdf2add33f1ea4f5c23'
7
+ data.tar.gz: f5f6f121775ff4331bd6b3b961f44cde4d7e51209309864b19bb43b709eb73ec3634eb2794326202bb8df3b988cca0bd54ab11ae1ed66438c09624252fede00f
@@ -18,22 +18,31 @@ module Cucumber
18
18
  root = File.expand_path(File.dirname(__FILE__) + '/../../..')
19
19
  @exe = C21e::ExeFile.new("#{root}/dots-formatter-go/dots-formatter-go-{{.OS}}-{{.Arch}}{{.Ext}}").target_file
20
20
  end
21
-
21
+
22
22
  def on_test_run_started(event)
23
- @stdin, stdout, stderr, @wait_thread = Open3.popen3(@exe)
23
+ @stdin, stdout, _stderr, @wait_thread = Open3.popen3(@exe)
24
24
  @out_thread = Thread.new do
25
- stdout.each_byte {|b| @out_stream << b.chr}
25
+ stdout.each_byte { |b| @out_stream << b.chr }
26
26
  end
27
27
  end
28
28
 
29
29
  def on_test_step_finished(event)
30
- wrapper = Cucumber::Messages::Wrapper.new(
31
- testStepFinished: Cucumber::Messages::TestStepFinished.new(
32
- testResult: Cucumber::Messages::TestResult.new(
33
- status: event.result.to_sym.upcase
34
- )
35
- )
36
- )
30
+ wrapper = event.test_step.hook? ?
31
+ Cucumber::Messages::Wrapper.new(
32
+ testHookFinished: Cucumber::Messages::TestHookFinished.new(
33
+ testResult: Cucumber::Messages::TestResult.new(
34
+ status: event.result.to_sym.upcase
35
+ )
36
+ )
37
+ )
38
+ :
39
+ Cucumber::Messages::Wrapper.new(
40
+ testStepFinished: Cucumber::Messages::TestStepFinished.new(
41
+ testResult: Cucumber::Messages::TestResult.new(
42
+ status: event.result.to_sym.upcase
43
+ )
44
+ )
45
+ )
37
46
  bytes = Cucumber::Messages::Wrapper.encode(wrapper)
38
47
  encode_varint(@stdin, bytes.unpack('C*').length)
39
48
  @stdin.write(bytes)
@@ -21,27 +21,36 @@ module Cucumber
21
21
  end
22
22
  end
23
23
 
24
- TestStepFinished = Struct.new(:result)
25
-
24
+ TestStep = Struct.new(:hook?)
25
+ TestStepFinished = Struct.new(:result, :test_step)
26
+
26
27
  describe Dots do
28
+ def hook_finished_event(status)
29
+ TestStepFinished.new(status, TestStep.new(true))
30
+ end
31
+
32
+ def gherkin_step_finished_event(status)
33
+ TestStepFinished.new(status, TestStep.new(false))
34
+ end
35
+
27
36
  it 'prints coloured dots' do
28
37
  config = StubConfig.new
29
- f = Dots.new(config)
30
-
38
+ Dots.new(config)
39
+
31
40
  config.test_run_started({})
32
- config.test_step_finished(TestStepFinished.new('failed'))
33
- config.test_step_finished(TestStepFinished.new('skipped'))
34
- config.test_step_finished(TestStepFinished.new('undefined'))
35
- config.test_step_finished(TestStepFinished.new('ambiguous'))
36
- config.test_step_finished(TestStepFinished.new('passed'))
37
- config.test_step_finished(TestStepFinished.new('pending'))
41
+ config.test_step_finished(hook_finished_event('failed'))
42
+ config.test_step_finished(gherkin_step_finished_event('failed'))
43
+ config.test_step_finished(gherkin_step_finished_event('skipped'))
44
+ config.test_step_finished(gherkin_step_finished_event('undefined'))
45
+ config.test_step_finished(gherkin_step_finished_event('ambiguous'))
46
+ config.test_step_finished(gherkin_step_finished_event('passed'))
47
+ config.test_step_finished(gherkin_step_finished_event('pending'))
38
48
  config.test_run_finished({})
39
-
49
+
40
50
  config.out_stream.rewind
41
51
  out = config.out_stream.read
42
-
43
- # F-UA.P in colours
44
- expect(out).to eq("\e[31mF\e[0m\e[36m-\e[0m\e[33mU\e[0m\e[35mA\e[0m\e[32m.\e[0m\e[33mP\e[0m\n")
52
+
53
+ expect(out).to eq(File.read(File.dirname(__FILE__) + '/expected_output.ansi'))
45
54
  end
46
55
  end
47
56
  end
@@ -0,0 +1 @@
1
+ HF-UA.P
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-formatter-dots
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wynne
@@ -112,6 +112,7 @@ files:
112
112
  - spec/capture_warnings.rb
113
113
  - spec/coverage.rb
114
114
  - spec/cucumber/formatter/dots_spec.rb
115
+ - spec/cucumber/formatter/expected_output.ansi
115
116
  homepage: https://github.com/cucumber/dots-formatter-ruby
116
117
  licenses:
117
118
  - MIT
@@ -133,11 +134,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
134
  version: '0'
134
135
  requirements: []
135
136
  rubyforge_project:
136
- rubygems_version: 2.7.7
137
+ rubygems_version: 2.7.4
137
138
  signing_key:
138
139
  specification_version: 4
139
- summary: cucumber-formatter-dots-1.0.4
140
+ summary: cucumber-formatter-dots-1.1.0
140
141
  test_files:
141
142
  - spec/capture_warnings.rb
142
143
  - spec/coverage.rb
143
144
  - spec/cucumber/formatter/dots_spec.rb
145
+ - spec/cucumber/formatter/expected_output.ansi