aslakhellesoy-cucumber 0.1.13.2 → 0.1.13.3

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.
data/History.txt CHANGED
@@ -4,10 +4,12 @@
4
4
  * Pretty formatter shows number of scenarios (#139 Joseph Wilk)
5
5
 
6
6
  === Bugfixes
7
+ * Fixed "No such file or directory -- cucumber (LoadError)" bug with AutoTest (Aslak Hellesøy)
7
8
  * Fixed `load_missing_constant': uninitialized constant Dispatcher error with Rails (Aslak Hellesøy)
8
9
 
9
10
  === Removed features
10
11
 
12
+
11
13
  == 0.1.13 2008-12-20
12
14
 
13
15
  It's time for some new features again. Output is now much better since you can use diffing, tweak
data/Manifest.txt CHANGED
@@ -111,9 +111,11 @@ examples/tickets/features/scenario_outline.feature
111
111
  examples/tickets/features/step_definitons/scenario_outline_steps.rb
112
112
  examples/tickets/features/step_definitons/tickets_steps.rb
113
113
  examples/tickets/features/tickets.feature
114
+ examples/watir/README.textile
114
115
  examples/watir/Rakefile
115
116
  examples/watir/features/search.feature
116
- examples/watir/features/step_definitons/stories_steps.rb
117
+ examples/watir/features/step_definitons/search_steps.rb
118
+ examples/watir/features/support/env.rb
117
119
  features/see_features.feature
118
120
  features/steps/features_steps.rb
119
121
  gem_tasks/deployment.rake
@@ -0,0 +1,27 @@
1
+ class GoogleSearch
2
+ def initialize(browser)
3
+ @browser = browser
4
+ end
5
+
6
+ def goto
7
+ @browser.goto 'http://www.google.com/'
8
+ end
9
+
10
+ def search(text)
11
+ @browser.text_field(:name, 'q').set(text)
12
+ @browser.button(:name, 'btnG').click
13
+ end
14
+ end
15
+
16
+ Given 'I am on the Google search page' do
17
+ @page = GoogleSearch.new(@browser)
18
+ @page.goto
19
+ end
20
+
21
+ When /I search for "(.*)"/ do |query|
22
+ @page.search(query)
23
+ end
24
+
25
+ Then /I should see a link to "(.*)":(.*)/ do |text, url|
26
+ @browser.link(:url, url).text.should == text
27
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec'
2
+
3
+ if ENV['FIREWATIR']
4
+ require 'firewatir'
5
+ Browser = FireWatir::Firefox
6
+ else
7
+ case RUBY_PLATFORM
8
+ when /darwin/
9
+ require 'safariwatir'
10
+ Browser = Watir::Safari
11
+ when /win32|mingw/
12
+ require 'watir'
13
+ Browser = Watir::IE
14
+ when /java/
15
+ require 'celerity'
16
+ Browser = Celerity::Browser
17
+ else
18
+ raise "This platform is not supported (#{PLATFORM})"
19
+ end
20
+ end
21
+
22
+ # "before all"
23
+ browser = Browser.new
24
+
25
+ Before do
26
+ @browser = browser
27
+ end
28
+
29
+ # "after all"
30
+ at_exit do
31
+ browser.close
32
+ end
@@ -122,10 +122,6 @@ module Autotest::CucumberMixin
122
122
  else
123
123
  scenario_args = scenarios_to_run.map { |s| "-s '#{s}'" }.join(' ')
124
124
  end
125
- return "#{$CUCUMBER_RUBY} #{cucumber} #{args} #{scenario_args}"
126
- end
127
-
128
- def cucumber
129
- File.file?("script/cucumber") ? "script/cucumber" : "cucumber"
125
+ return "#{Cucumber::RUBY} #{Cucumber::BINARY} #{args} #{scenario_args}"
130
126
  end
131
127
  end
@@ -20,7 +20,7 @@ class String
20
20
  s
21
21
  end
22
22
 
23
- if ($CUCUMBER_JRUBY && $CUCUMBER_RAILS)
23
+ if (Cucumber::JRUBY && Cucumber::RAILS)
24
24
  # Workaround for http://tinyurl.com/55uu3u
25
25
  alias jlength length
26
26
  else
@@ -5,7 +5,7 @@ gem 'term-ansicolor'
5
5
  $LOAD_PATH.each{|path| $LOAD_PATH.unshift($LOAD_PATH.delete(path)) if path =~ /term-ansicolor/}
6
6
  require 'term/ansicolor'
7
7
 
8
- if $CUCUMBER_WINDOWS_MRI
8
+ if Cucumber::WINDOWS_MRI
9
9
  begin
10
10
  require 'Win32/Console/ANSI'
11
11
  rescue LoadError
@@ -14,23 +14,26 @@ if $CUCUMBER_WINDOWS_MRI
14
14
  end
15
15
  end
16
16
 
17
- Term::ANSIColor.coloring = false if !STDOUT.tty? || ($CUCUMBER_WINDOWS && !$CUCUMBER_WINDOWS_MRI)
17
+ Term::ANSIColor.coloring = false if !STDOUT.tty? || (Cucumber::WINDOWS && !Cucumber::WINDOWS_MRI)
18
18
 
19
19
  module Cucumber
20
20
  module Formatters
21
21
  # Defines aliases for coloured output. You can tweak the colours by defining
22
- # a <tt>$CUCUMBER_COLORS</tt> variable in your shell, very much like you can
22
+ # a <tt>Cucumber::COLORS</tt> variable in your shell, very much like you can
23
23
  # tweak the familiar POSIX command <tt>ls</tt> with
24
24
  # <a href="http://mipsisrisc.com/rambling/2008/06/27/lscolorsls_colors-now-with-linux-support/">$LSCOLORS/$LS_COLORS</a>
25
25
  #
26
26
  # The colours that you can change are:
27
27
  #
28
+ # * <tt>missing</tt> - defaults to <tt>yellow</tt>
28
29
  # * <tt>pending</tt> - defaults to <tt>yellow</tt>
29
30
  # * <tt>pending_param</tt> - defaults to <tt>yellow,bold</tt>
30
31
  # * <tt>failed</tt> - defaults to <tt>red</tt>
31
32
  # * <tt>failed_param</tt> - defaults to <tt>red,bold</tt>
32
33
  # * <tt>passed</tt> - defaults to <tt>green</tt>
33
34
  # * <tt>passed_param</tt> - defaults to <tt>green,bold</tt>
35
+ # * <tt>outline</tt> - defaults to <tt>cyan</tt>
36
+ # * <tt>outline_param</tt> - defaults to <tt>cyan,bold</tt>
34
37
  # * <tt>skipped</tt> - defaults to <tt>cyan</tt>
35
38
  # * <tt>skipped_param</tt> - defaults to <tt>cyan,bold</tt>
36
39
  # * <tt>comment</tt> - defaults to <tt>grey</tt>
@@ -66,9 +69,11 @@ module Cucumber
66
69
  h[$1] + ',bold'
67
70
  end
68
71
  end.merge({
72
+ 'missing' => 'yellow',
69
73
  'pending' => 'yellow',
70
74
  'failed' => 'red',
71
75
  'passed' => 'green',
76
+ 'outline' => 'cyan',
72
77
  'skipped' => 'cyan',
73
78
  'comment' => 'grey',
74
79
  'tag' => 'blue'
@@ -4,23 +4,23 @@ require 'cucumber/formatters/ansicolor'
4
4
 
5
5
  $KCODE='u'
6
6
 
7
- if $CUCUMBER_WINDOWS_MRI && `chcp` =~ /Active code page: (\d+)/
7
+ if Cucumber::WINDOWS_MRI && `chcp` =~ /Active code page: (\d+)/
8
8
  codepage = $1.to_i
9
9
  codepages = (1251..1252)
10
10
 
11
11
  if codepages.include?(codepage)
12
- $CUCUMBER_CODEPAGE = "cp#{codepage}"
12
+ Cucumber::CODEPAGE = "cp#{codepage}"
13
13
 
14
14
  require 'iconv'
15
15
  module Kernel
16
16
  alias cucumber_print print
17
17
  def print(*a)
18
- cucumber_print *Iconv.iconv($CUCUMBER_CODEPAGE, "UTF-8", *a)
18
+ cucumber_print *Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a)
19
19
  end
20
20
 
21
21
  alias cucumber_puts puts
22
22
  def puts(*a)
23
- cucumber_puts *Iconv.iconv($CUCUMBER_CODEPAGE, "UTF-8", *a)
23
+ cucumber_puts *Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a)
24
24
  end
25
25
  end
26
26
  end
@@ -2,9 +2,30 @@
2
2
  # in various places.
3
3
  require 'rbconfig'
4
4
 
5
- $CUCUMBER_JRUBY = defined?(JRUBY_VERSION)
6
- $CUCUMBER_IRONRUBY = Config::CONFIG['sitedir'] =~ /IronRuby/
7
- $CUCUMBER_WINDOWS = Config::CONFIG['host_os'] =~ /mswin|mingw/
8
- $CUCUMBER_WINDOWS_MRI = $CUCUMBER_WINDOWS && !$CUCUMBER_JRUBY && !$CUCUMBER_IRONRUBY
9
- $CUCUMBER_RAILS = defined?(Rails)
10
- $CUCUMBER_RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
5
+ module Cucumber
6
+ LANGUAGE_FILE = File.expand_path(File.dirname(__FILE__) + '/languages.yml')
7
+ BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/cucumber')
8
+ JRUBY = defined?(JRUBY_VERSION)
9
+ IRONRUBY = Config::CONFIG['sitedir'] =~ /IronRuby/
10
+ WINDOWS = Config::CONFIG['host_os'] =~ /mswin|mingw/
11
+ WINDOWS_MRI = WINDOWS && !JRUBY && !IRONRUBY
12
+ RAILS = defined?(Rails)
13
+ RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
14
+
15
+ class << self
16
+ attr_reader :language
17
+
18
+ def load_language(lang)
19
+ @language = config[lang]
20
+ end
21
+
22
+ def languages
23
+ config.keys.sort
24
+ end
25
+
26
+ def config
27
+ require 'yaml'
28
+ @config ||= YAML.load_file(LANGUAGE_FILE)
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,5 @@
1
+ require 'cucumber/platform'
2
+
1
3
  module Cucumber
2
4
  module Rake
3
5
  # Defines a task for running features.
@@ -5,7 +7,6 @@ module Cucumber
5
7
  LIB = File.expand_path(File.dirname(__FILE__) + '/../..')
6
8
 
7
9
  attr_accessor :libs
8
- attr_accessor :binary
9
10
  attr_accessor :step_list
10
11
  attr_accessor :step_pattern
11
12
  attr_accessor :feature_list
@@ -24,7 +25,6 @@ module Cucumber
24
25
 
25
26
  @feature_pattern = "features/**/*.feature" if feature_pattern.nil? && feature_list.nil?
26
27
  @step_pattern = "features/**/*.rb" if step_pattern.nil? && step_list.nil?
27
- @binary ||= File.expand_path(File.dirname(__FILE__) + '/../../../bin/cucumber')
28
28
  define_task
29
29
  end
30
30
 
@@ -37,7 +37,7 @@ module Cucumber
37
37
 
38
38
  def arguments_for_ruby_execution(task_args = nil)
39
39
  lib_args = ['"%s"' % ([LIB] + libs).join(File::PATH_SEPARATOR)]
40
- cucumber_bin = ['"%s"' % binary]
40
+ cucumber_bin = ['"%s"' % Cucumber::BINARY]
41
41
  cuc_opts = [(ENV['CUCUMBER_OPTS'] || cucumber_opts)]
42
42
 
43
43
  step_files(task_args).each do |step_file|
@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
5
  TINY = 13
6
- PATCH = 3 # Set to nil for official release
6
+ PATCH = 4 # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
data/lib/cucumber.rb CHANGED
@@ -17,24 +17,3 @@ require 'cucumber/cli'
17
17
  require 'cucumber/broadcaster'
18
18
  require 'cucumber/world'
19
19
  require 'cucumber/core_ext/exception'
20
-
21
- module Cucumber
22
- LANGUAGE_FILE = File.expand_path(File.dirname(__FILE__) + '/cucumber/languages.yml')
23
-
24
- class << self
25
- attr_reader :language
26
-
27
- def load_language(lang)
28
- @language = config[lang]
29
- end
30
-
31
- def languages
32
- config.keys.sort
33
- end
34
-
35
- def config
36
- require 'yaml'
37
- @config ||= YAML.load_file(LANGUAGE_FILE)
38
- end
39
- end
40
- end
@@ -5,13 +5,14 @@ module ActiveRecord
5
5
  end
6
6
 
7
7
  module ActionController
8
+ class Dispatcher
9
+ end
10
+
8
11
  class Base
9
12
  end
13
+
10
14
  class IntegrationTest
11
15
  def self.use_transactional_fixtures=(x)
12
16
  end
13
17
  end
14
18
  end
15
-
16
- module Dispatcher
17
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aslakhellesoy-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13.2
4
+ version: 0.1.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-24 00:00:00 -08:00
12
+ date: 2008-12-29 00:00:00 -08:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -177,7 +177,8 @@ files:
177
177
  - examples/tickets/features/tickets.feature
178
178
  - examples/watir/Rakefile
179
179
  - examples/watir/features/search.feature
180
- - examples/watir/features/step_definitons/stories_steps.rb
180
+ - examples/watir/features/step_definitons/search_steps.rb
181
+ - examples/watir/features/support/env.rb
181
182
  - features/see_features.feature
182
183
  - features/steps/features_steps.rb
183
184
  - gem_tasks/deployment.rake
@@ -1,51 +0,0 @@
1
- require 'spec'
2
-
3
- case PLATFORM
4
- when /darwin/
5
- require 'safariwatir'
6
- Browser = Watir::Safari
7
- when /win32|mingw/
8
- require 'watir'
9
- Browser = Watir::IE
10
- when /java/
11
- require 'celerity'
12
- Browser = Celerity::Browser
13
- else
14
- raise "This platform is not supported (#{PLATFORM})"
15
- end
16
-
17
- Before do
18
- @b = Browser.new
19
- end
20
-
21
- After do
22
- @b.close
23
- end
24
-
25
- class GoogleSearch
26
- def initialize(b)
27
- @b = b
28
- end
29
-
30
- def goto
31
- @b.goto 'http://www.google.com/'
32
- end
33
-
34
- def search(text)
35
- @b.text_field(:name, 'q').set(text)
36
- @b.button(:name, 'btnG').click
37
- end
38
- end
39
-
40
- Given 'I am on the Google search page' do
41
- @page = GoogleSearch.new(@b)
42
- @page.goto
43
- end
44
-
45
- When /I search for "(.*)"/ do |query|
46
- @page.search(query)
47
- end
48
-
49
- Then /I should see a link to "(.*)":(.*)/ do |text, url|
50
- @b.link(:url, url).text.should == text
51
- end