spreewald 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - "1.8.7"
4
4
  - "1.9.3"
5
5
  - ree
6
+ - "2.0.0"
6
7
  script: rake travis:run
7
8
  notifications:
8
9
  email:
data/Rakefile CHANGED
@@ -4,10 +4,14 @@ require "bundler/gem_tasks"
4
4
  desc 'Default: Run all tests.'
5
5
  task :default => 'all:features'
6
6
 
7
-
8
7
  desc 'Update the "Steps" section of the README'
9
8
  task :update_readme do
10
- require 'support/documentation_generator'
9
+ if Kernel.respond_to? :require_relative
10
+ require_relative './support/documentation_generator'
11
+ else
12
+ require 'support/documentation_generator'
13
+ end
14
+
11
15
  readme = File.read('README.md')
12
16
  start_of_steps_section = readme =~ /^## Steps/
13
17
  length_of_steps_section = (readme[(start_of_steps_section+1)..-1] =~ /^##[^#]/) || readme.size - start_of_steps_section
@@ -16,13 +20,13 @@ task :update_readme do
16
20
  end
17
21
 
18
22
  namespace :travis do
19
-
23
+
20
24
  desc 'Run tests in Travis CI'
21
25
  task :run => [:slimgems, 'all:bundle', 'all:features']
22
-
26
+
23
27
  desc 'Install slimgems'
24
28
  task :slimgems do
25
- system('gem install slimgems')
29
+ sh 'gem install slimgems' unless modern_ruby?
26
30
  end
27
31
  end
28
32
 
@@ -50,13 +54,17 @@ namespace :all do
50
54
  end
51
55
  end
52
56
 
57
+ def modern_ruby?
58
+ Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.8.7')
59
+ end
60
+
53
61
  def for_each_directory_of(path, &block)
54
62
  Dir[path].sort.each do |rakefile|
55
63
  directory = File.dirname(rakefile)
56
64
  puts '', "\033[44m#{directory}\033[0m", ''
57
65
 
58
- if RUBY_VERSION.start_with?("1.9") and directory.include?("rails-2.3")
59
- puts 'Skipping Rails 2.3 with Ruby 1.9.'
66
+ if modern_ruby? and directory.include?("rails-2.3")
67
+ puts "Rails 2.3 Tests are skipped for Rubies younger than versions 1.8.7"
60
68
  else
61
69
  block.call(directory)
62
70
  end
@@ -5,9 +5,14 @@ Then /^it should work$/ do
5
5
  pending
6
6
  end
7
7
 
8
- # Starts debugger
8
+ # Starts debugger, or Pry if installed
9
9
  Then /^debugger$/ do
10
- debugger
10
+ if binding.respond_to? :pry
11
+ binding.pry
12
+ else
13
+ debugger
14
+ end
15
+
11
16
  true # Ruby will halt in this line
12
17
  end
13
18
 
@@ -3,7 +3,7 @@ module CustomMatchers
3
3
 
4
4
  rspec::Matchers.define :contain_with_wildcards do |expected_string|
5
5
  match do |field_value|
6
- @field_value = field_value
6
+ @field_value = field_value.to_s
7
7
  @expected_string = expected_string
8
8
  regex_parts = expected_string.split('*', -1).collect { |part| Regexp.escape(part) }
9
9
 
@@ -11,11 +11,11 @@ module CustomMatchers
11
11
  end
12
12
 
13
13
  failure_message_for_should do
14
- "The field's content #@field_value did not match #@expected_string"
14
+ "The field's content #{@field_value.inspect} did not match #{@expected_string.inspect}"
15
15
  end
16
16
 
17
17
  failure_message_for_should_not do
18
- "The field's content #@field_value matches #@expected_string"
18
+ "The field's content #{@field_value.inspect} matches #{@expected_string.inspect}"
19
19
  end
20
20
  end
21
21
 
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '0.8.3'
2
+ VERSION = '0.8.4'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (0.8.3)
4
+ spreewald (0.8.4)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber-rails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (0.8.3)
4
+ spreewald (0.8.4)
5
5
  capybara
6
6
  cucumber
7
7
  cucumber-rails
@@ -12,3 +12,6 @@
12
12
  = label_tag 'textarea_control', 'Textarea control'
13
13
  = text_area_tag 'textarea_control', 'Textarea control value'
14
14
 
15
+ = label_tag 'empty_control', 'Empty control'
16
+ = text_field_tag 'empty_control'
17
+
@@ -8,6 +8,7 @@ Feature: Web steps
8
8
  Then the "Select control" field should contain "Label 2"
9
9
  Then the "Select control without selection" field should contain "Label 1"
10
10
  Then the "Textarea control" field should contain "Textarea control value"
11
+ Then the "Empty control" field should contain ""
11
12
 
12
13
  Scenario: /^I should see a form with the following values:$/
13
14
  Then I should see a form with the following values:
@@ -15,6 +16,7 @@ Feature: Web steps
15
16
  | Select control | Label 2 |
16
17
  | Select control without selection | Label 1 |
17
18
  | Textarea control | Textarea control value |
19
+ | Empty control | |
18
20
 
19
21
  Scenario: /^"([^"]*)" should be selected for "([^"]*)"$/
20
22
  Then "Label 2" should be selected for "Select control"
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: 57
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 3
10
- version: 0.8.3
9
+ - 4
10
+ version: 0.8.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Kraze
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-12-09 00:00:00 +01:00
18
+ date: 2013-12-12 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -71,7 +71,6 @@ extra_rdoc_files: []
71
71
 
72
72
  files:
73
73
  - .gitignore
74
- - .ruby-version
75
74
  - .travis.yml
76
75
  - LICENSE
77
76
  - README.md
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 1.8.7