Sha256: aeb62f3b4ce3f8a633d1a991eea2b59e413e59095d359bc378a904fc2aec6856

Contents?: true

Size: 1.22 KB

Versions: 4

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
  step %(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

4 entries across 4 versions & 1 rubygems

Version Path
visage-app-2.0.5 features/step_definitions/cli_steps.rb
visage-app-2.0.4 features/step_definitions/cli_steps.rb
visage-app-2.0.2 features/step_definitions/cli_steps.rb
visage-app-2.0.0 features/step_definitions/cli_steps.rb