Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cucumber support files use modules instead of polluting root namespace

  • Loading branch information...
commit efe250e4d397a84b3ae04ce52b47d8a604241ee0 1 parent d119542
@drnic authored
View
2  features/step_definitions/cli_steps.rb
@@ -1,5 +1,3 @@
-# force_local_lib_override
-
When /^I execute rbiphonetest for project '(.*)' with options '(.*)'/ do |project_name, arguments|
setup_active_project_folder project_name
in_tmp_folder do
View
9 features/support/cli.rb
@@ -1,3 +1,8 @@
-def rbiphonetest_cmd
- @rbiphonetest_cmd ||= File.expand_path(File.dirname(__FILE__) + "/../../../bin/rbiphonetest")
+module CliHelpers
+ def rbiphonetest_cmd
+ @rbiphonetest_cmd ||= File.expand_path(File.dirname(__FILE__) + "/../../../bin/rbiphonetest")
+ end
end
+
+World { |world| world.extend CliHelpers }
+
View
42 features/support/common.rb
@@ -1,25 +1,29 @@
-def in_tmp_folder(&block)
- FileUtils.chdir(@tmp_root, &block)
-end
+module CommonHelpers
+ def in_tmp_folder(&block)
+ FileUtils.chdir(@tmp_root, &block)
+ end
-def in_project_folder(&block)
- project_folder = @active_project_folder || @tmp_root
- FileUtils.chdir(project_folder, &block)
-end
+ def in_project_folder(&block)
+ project_folder = @active_project_folder || @tmp_root
+ FileUtils.chdir(project_folder, &block)
+ end
-def in_home_folder(&block)
- FileUtils.chdir(@home_path, &block)
-end
+ def in_home_folder(&block)
+ FileUtils.chdir(@home_path, &block)
+ end
-def force_local_lib_override(project_name = @project_name)
- rakefile = File.read(File.join(project_name, 'Rakefile'))
- File.open(File.join(project_name, 'Rakefile'), "w+") do |f|
- f << "$:.unshift('#{@lib_path}')\n"
- f << rakefile
+ def force_local_lib_override(project_name = @project_name)
+ rakefile = File.read(File.join(project_name, 'Rakefile'))
+ File.open(File.join(project_name, 'Rakefile'), "w+") do |f|
+ f << "$:.unshift('#{@lib_path}')\n"
+ f << rakefile
+ end
end
-end
-def setup_active_project_folder project_name
- @active_project_folder = File.join(@tmp_root, project_name)
- @project_name = project_name
+ def setup_active_project_folder project_name
+ @active_project_folder = File.join(@tmp_root, project_name)
+ @project_name = project_name
+ end
end
+
+World { |world| world.extend CommonHelpers }
Please sign in to comment.
Something went wrong with that request. Please try again.