Sha256: 1f176c6e10a9ebfc2e95dcd0b14a5731d672bb3cda8777a26e98eaefc09715c1

Contents?: true

Size: 1.22 KB

Versions: 14

Compression:

Stored size: 1.22 KB

Contents

Given /^the "([^"]*)" gem is installed$/ do |name|
  `gem list #{name} |grep #{name}`.size.should > 0
end

When /^I start the visage server helper with "([^"]*)"$/ do |cmd|
  @root = Pathname.new(File.dirname(__FILE__)).parent.parent.expand_path
  command = "#{@root.join('bin')}/#{cmd}"

  @pipe = IO.popen(command, "r")
  sleep 2 # so the visage server has a chance to boot

  # clean up the visage server when the tests finish
  at_exit do
    Process.kill("KILL", @pipe.pid)
  end
end

Then /^a visage web server should be running$/ do
  `ps -eo cmd |grep ^visage`.size.should > 0
end

Then /^I should see "([^"]*)" on the terminal$/ do |string|
  output = @pipe.read(250)
  output.should =~ /#{string}/
end

Given /^there is no file at "([^"]*)"$/ do |filename|
  FileUtils.rm_f(filename).should be_true
end

When /^I start the visage server helper with "([^"]*)" and the following variables:$/ do |cmd, table|
  table.hashes.each do |hash|
    hash.each_pair do |variable, value|
      ENV[variable] = value
    end
  end
  When %(I start the visage server helper with "#{cmd}")
end

Then /^I should see a file at "([^"]*)"$/ do |filename|
  File.exists?(filename).should be_true
end

Then /^show me the output$/ do
  puts @pipe.read(250)
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
visage-app-1.0.0 features/step_definitions/visage_steps.rb
visage-app-0.9.6 features/step_definitions/visage_steps.rb
visage-app-0.9.5 features/step_definitions/visage_steps.rb
visage-app-0.9.4 features/step_definitions/visage_steps.rb
visage-app-0.9.3 features/step_definitions/visage_steps.rb
visage-app-0.9.2 features/step_definitions/visage_steps.rb
visage-app-0.9.1 features/step_definitions/visage_steps.rb
visage-app-0.9.0.pre2 features/step_definitions/visage_steps.rb
visage-app-0.9.0 features/step_definitions/visage_steps.rb
visage-app-0.9.0.pre1 features/step_definitions/visage_steps.rb
visage-app-0.3.3 features/step_definitions/visage_steps.rb
visage-app-0.3.2 features/step_definitions/visage_steps.rb
visage-app-0.3.1 features/step_definitions/visage_steps.rb
visage-app-0.3.0 features/step_definitions/visage_steps.rb