Sha256: 2fd72101011f2f24a2a9a8499aa3e2e4e10a782675ec9b75521a72bc912d9d27

Contents?: true

Size: 1.76 KB

Versions: 19

Compression:

Stored size: 1.76 KB

Contents

Given /^I have open a file$/ do
  Swt.sync_exec do
    Redcar::Project::OpenFileCommand.new.run
  end
end

Given /^I will open a large file from the "([^"]*)" dialog$/ do |arg1|
  Swt.sync_exec do
    Given %Q|I will choose "plugins/project/spec/fixtures/winter.txt" from the "open_file" dialog|
    Redcar::Project::Manager.file_size_limit = 1
  end
end

When /^I open a file$/ do
  Swt.sync_exec do
    Redcar::Project::OpenFileCommand.new.run
  end
end

Given /^I have opened "([^\"]*)"$/ do |arg1|
  Swt.sync_exec do
    Redcar::Project::OpenFileCommand.new(File.expand_path(arg1)).run
  end
end

Given /^I have opened "([^\"]*)" from the project$/ do |arg1|
  Swt.sync_exec do
    project = Redcar::Project::Manager.focussed_project
    Redcar::Project::OpenFileCommand.new(project.path + "/" + arg1).run
  end
end

When /^I save the tab$/ do
  Swt.sync_exec do
    Redcar::Project::SaveFileCommand.new.run
  end
end

When /^I touch the file "([^\"]*)"$/ do |fn|
  FileUtils.touch(fn)
  add_test_file(fn)
end

When /^I put "([^\"]*)" into the file "([^\"]*)"$/ do |contents, path|
  File.open(path, "w") {|fout| fout.print contents }
end

When /^I save the tab as$/ do
  Swt.sync_exec do
    Redcar::Project::SaveFileAsCommand.new.run
  end
end

Then /^the file "([^"]*)" should be deletable$/ do |path|
  File.delete path
  raise if File.exist? path
end

Then /^the file "([^\"]*)" should contain "([^\"]*)"$/ do |arg1, arg2|
  File.read(arg1).should == arg2
end

When /^I put a lot of lines into the file "([^\"]*)"$/ do |file|
  File.open(file, "w") do |f|
    200.times { |i| f.puts(i * 20) }
  end
end

def add_test_file(fn)
  (@test_files ||= []) << File.expand_path(fn)
end

def remove_test_files
  (@test_files||[]).each { |fn| FileUtils.rm_f(fn) }
end

After do
  remove_test_files
end

Version data entries

19 entries across 19 versions & 2 rubygems

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