crudecumber 0.2.1 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fc1c7c579535aaa96578220c633c8e3371ee440
4
- data.tar.gz: 963b56214665246b20432cb4170798bfc818a3b7
3
+ metadata.gz: 193b96e1f0ec977671951e5f3b2994ab24fabe03
4
+ data.tar.gz: 496fc7bad55df7b6947cca165dc4a928a17b0f6d
5
5
  SHA512:
6
- metadata.gz: f9280b7e90c92a78469673b9d179cedbeaea76fb247358036c62fa26425c36353a5af29b4fac6b73341a92cd18e970a80aef6ff7602bb3cb44f5b61ec4e82650
7
- data.tar.gz: 273d8dbe3fdf5c1ab8cb8ee378e6ceaa78fcc3f975c51a7ade1b9ea7db38d48b93dd379e910032594fabb2e8a10ad6b43d7b67a98cb29da9582633c7a1f410b2
6
+ metadata.gz: c3b629741b7a72c408b09ad576c1388da9c7c7bde2e2e188d8810b16f7d792787c17728665fddc2eb00e539363d2703e2dda9facb62aa0333cfcb516b773807e
7
+ data.tar.gz: 6f05e61389e25a82f327adfc7c8d735f2aa3945a787328a0214f458c70ebac3970dba8c76200d6ba811be3bdeaddf5e3e3afd70237a0eddbad87c2be489952e5
@@ -6,12 +6,12 @@ Then(/^.*$/) do | *x |
6
6
  Cucumber.trap_interrupt
7
7
  key = capture_key
8
8
  if skipped?(key)
9
- puts ' Test skipped'
9
+ puts " Test skipped\033[K"
10
10
  pending
11
11
  else
12
12
  unless pass?(key)
13
13
  print "\n Describe the problem: "
14
- puts ' Notes: ' + STDIN.gets.chomp
14
+ puts " Notes: #{STDIN.gets.chomp}\033[K"
15
15
  fail
16
16
  end
17
17
  end
@@ -11,10 +11,31 @@ module Crudecumber
11
11
  class Formatter < Cucumber::Formatter::Pretty
12
12
  def before_step(step)
13
13
  @io.printf "#{step.keyword}#{step.name}".indent(@scenario_indent + 2)
14
- @io.flush
14
+ unless step.multiline_arg.nil?
15
+ @io.printf "#{step.multiline_arg}".indent(@scenario_indent + 2)
16
+ end
17
+ super
15
18
  end
16
19
 
17
20
  def before_step_result(*args)
21
+ is_table = args[2].is_a?(Cucumber::Ast::Table)
22
+ table_rows = is_table ? args[2].raw.length : 0
23
+
24
+ if is_table # If there is a table
25
+ case args[3]
26
+ when :failed
27
+ @io.printf "\033[#{table_rows + 3}A"
28
+ when :pending
29
+ @io.printf "\033[#{table_rows + 1}A"
30
+ when :passed
31
+ @io.printf "\033[#{table_rows + 1}A"
32
+ end
33
+ else
34
+ case args[3]
35
+ when :failed
36
+ @io.printf "\033[2A"
37
+ end
38
+ end
18
39
  @io.printf "\r\033[K"
19
40
  super
20
41
  end
@@ -22,6 +43,17 @@ module Crudecumber
22
43
  def exception(_arg_1, _arg_2)
23
44
  # Do nothing
24
45
  end
46
+
47
+ def table_cell_value(value, status)
48
+ return if !@table || @hide_this_step
49
+ status ||= @status || :passed
50
+ width = @table.col_width(@col_index)
51
+ cell_text = escape_cell(value.to_s || '')
52
+ padded = cell_text + (' ' * (width - cell_text.unpack('U*').length))
53
+ prefix = cell_prefix(status)
54
+ @io.print(' ' + format_string("#{prefix} #{padded}", status) + ::Cucumber::Term::ANSIColor.reset(' |'))
55
+ @io.flush
56
+ end
25
57
  end
26
58
 
27
59
  # Custom formatter that inherits from the standard Cucumber 'Html' formatter
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crudecumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Buckland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-17 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -70,5 +70,5 @@ rubyforge_project:
70
70
  rubygems_version: 2.6.10
71
71
  signing_key:
72
72
  specification_version: 4
73
- summary: Crudecumber 0.2.1
73
+ summary: Crudecumber 0.3.0
74
74
  test_files: []