lib/cuken/cucumber/common.rb in cuken-0.1.13 vs lib/cuken/cucumber/common.rb in cuken-0.1.15

- old
+ new

@@ -13,10 +13,52 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # +World(::Cuken::Api::Common) + +require 'cuken/cucumber/output/all' +require 'cuken/cucumber/output/cmd' +require 'cuken/cucumber/output/stderr' +require 'cuken/cucumber/output/stdout' + +Before('@fast') do + @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 6 ? @aruba_timeout_seconds = 6 : @aruba_timeout_seconds +end +Before('@quick') do + @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 20 ? @aruba_timeout_seconds = 20 : @aruba_timeout_seconds +end +Before('@slow') do + @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 60 ? @aruba_timeout_seconds = 60 : @aruba_timeout_seconds +end +Before('@glacial') do + @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 600 ? @aruba_timeout_seconds = 600 : @aruba_timeout_seconds +end +# Some VM builds can take a while, depending on package repository speeds etc. +# Note: +# In a genuine disaster scenario you are more likely to, eventually, trying throwing this at the top of a feature file :( +Before('@cosmic') do + @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 3600 ? @aruba_timeout_seconds = 3600 : @aruba_timeout_seconds +end + +When /^I cd to "([^"]*)"$/ do |dir| + cd(dir) +end + +Given /^the working directory is "([^"]*)"$/ do |path| + @dirs = [path] +end + +And /^wait "([^"]*)" seconds$/ do |delay| + ::Kernel.sleep(delay.to_f) +end + +Given /^I'm using a clean gemset "([^"]*)"$/ do |gemset| + use_clean_gemset(gemset) +end + Given /^Assumption: (.*)$/ do |msg| announce_or_puts(msg) end Given /^Explanation: (.*)$/ do |msg| @@ -25,12 +67,6 @@ Given /^Instruction: (.*)$/ do |msg| announce_or_puts(msg) end -And /^wait "([^"]*)" seconds$/ do |delay| - ::Kernel.sleep(delay.to_f) -end -Given /^the working directory is "([^"]*)"$/ do |path| - @dirs = [path] -end \ No newline at end of file