spreewald 0.2.0 → 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.
@@ -436,6 +436,7 @@ end
436
436
  # Example:
437
437
  #
438
438
  # Then I should see an element ".page .container"
439
+ #
439
440
  Then /^I should (not )?see an element "([^"]*)"$/ do |negate, selector|
440
441
  expectation = negate ? :should_not : :should
441
442
  patiently do
@@ -491,3 +492,25 @@ When /^I enter "([^"]*)" into the browser dialog$/ do |text|
491
492
  alert.send_keys(text)
492
493
  alert.accept
493
494
  end
495
+
496
+ # Checks that these strings are rendered in the given order in a single line or in multiple lines
497
+ #
498
+ # Example:
499
+ #
500
+ # Then I should see in this order:
501
+ # | Alpha Group |
502
+ # | Augsburg |
503
+ # | Berlin |
504
+ # | Beta Group |
505
+ #
506
+ Then /^I should see in this order:?$/ do |text|
507
+ if text.is_a?(String)
508
+ lines = text.split(/\n/)
509
+ else
510
+ lines = text.raw.flatten
511
+ end
512
+ lines = lines.collect { |line| line.gsub(/\s+/, ' ')}.collect(&:strip).reject(&:blank?)
513
+ pattern = lines.collect(&Regexp.method(:quote)).join('.*?')
514
+ pattern = Regexp.compile(pattern)
515
+ page.body.gsub(/\s+/, ' ').should =~ pattern
516
+ end
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module Spreewald
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Kraze