Sha256: bf810c6a4b3fddf9358c1d646e98f36d6adae4f8a242fb9ea498821e29519b5d

Contents?: true

Size: 1.05 KB

Versions: 35

Compression:

Stored size: 1.05 KB

Contents

require 'timeout'
require 'drb'

def drb
  DRbObject.new(nil, "druby://127.0.0.1:#{Redcar.drb_port}")
end

def tempfile(text)
  f = Tempfile.open("drb_testing")
  f << text
  f.close
  f.path
end

Given /^I open "([^"]*)" using the redcar command$/ do |path|
  drb_answer = drb.open_item_drb(File.expand_path(path))
  drb_answer.should == "ok"
end

Given /^I open "([^"]*)" using the redcar command with "-w"$/ do |path|
  DrbShelloutHelper.drb_system_thread = Thread.new(path) do
    drb_answer = drb.open_item_drb(File.expand_path(path), false, true)
  end
end

Given /^I pipe "([^"]*)" into redcar with "-w"$/ do |text|
  DrbShelloutHelper.drb_system_thread = Thread.new(text) do
    drb_answer = drb.open_item_drb(tempfile(text), true, true)
  end
end

Given /^I pipe "([^"]*)" into redcar$/ do |text|
  drb_answer = drb.open_item_drb(tempfile(text), true)
  drb_answer.should == "ok"
end

Then /^the redcar command should (not )?have returned$/ do |returned|
  (!!DrbShelloutHelper.drb_system_thread.status).should be !!returned # status is false for returned thread
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
redcar-0.13 plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.13.5dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.13.4dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.13.3dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.13.2dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.13.1dev plugins/project/features/step_definitions/drb_steps.rb
redcar-0.12.1 plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.13.0dev plugins/project/features/step_definitions/drb_steps.rb
redcar-0.12 plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.27dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.26dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.25dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.24dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.23dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.22dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.21dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.20dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.19dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.18dev plugins/project/features/step_definitions/drb_steps.rb
redcar-dev-0.12.17dev plugins/project/features/step_definitions/drb_steps.rb