redcar-dev 0.12.17dev → 0.12.18dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. data/CHANGES +4 -2
  2. data/README.md +5 -41
  3. data/Rakefile +3 -35
  4. data/lib/redcar.rb +19 -17
  5. data/lib/redcar/runner.rb +1 -7
  6. data/lib/redcar_quick_start.rb +5 -5
  7. data/plugins/application/features/main_menu.feature +1 -1
  8. data/plugins/application/features/step_definitions/command_steps.rb +8 -7
  9. data/plugins/application/features/step_definitions/filter_list_dialog_steps.rb +25 -10
  10. data/plugins/application/features/step_definitions/key_steps.rb +6 -4
  11. data/plugins/application/features/step_definitions/menu_steps.rb +27 -26
  12. data/plugins/application/features/step_definitions/speedbar_steps.rb +28 -16
  13. data/plugins/application/features/step_definitions/tree_steps.rb +88 -64
  14. data/plugins/application/features/step_definitions/window_steps.rb +14 -10
  15. data/plugins/application/features/support/env.rb +85 -83
  16. data/plugins/application/spec/application/application_spec.rb +1 -1
  17. data/plugins/application/spec/application/clipboard_spec.rb +1 -1
  18. data/plugins/application/spec/application/command/executor_spec.rb +1 -1
  19. data/plugins/application/spec/application/command/history_spec.rb +1 -1
  20. data/plugins/application/spec/application/command_spec.rb +1 -1
  21. data/plugins/application/spec/application/keymap/builder_spec.rb +1 -1
  22. data/plugins/application/spec/application/menu/builder_spec.rb +1 -1
  23. data/plugins/application/spec/application/menu/menu_item_spec.rb +1 -1
  24. data/plugins/application/spec/application/menu_spec.rb +1 -1
  25. data/plugins/application/spec/application/navigation_history_spec.rb +2 -0
  26. data/plugins/application/spec/application/notebook_spec.rb +1 -1
  27. data/plugins/application/spec/application/sensitive_spec.rb +1 -1
  28. data/plugins/application/spec/application/speedbar_spec.rb +1 -1
  29. data/plugins/application/spec/application/treebook_spec.rb +1 -1
  30. data/plugins/application/spec/application/window_spec.rb +1 -1
  31. data/plugins/application/spec/spec_helper.rb +4 -6
  32. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +1 -1
  33. data/plugins/application_swt/lib/application_swt/gradient.rb +15 -5
  34. data/plugins/application_swt/lib/application_swt/window.rb +1 -1
  35. data/plugins/application_swt/spec/application_swt/gradient_spec.rb +13 -14
  36. data/plugins/application_swt/spec/application_swt/menu/binding_translator_spec.rb +1 -1
  37. data/plugins/application_swt/spec/application_swt/menu_spec.rb +1 -1
  38. data/plugins/application_swt/spec/spec_helper.rb +1 -19
  39. data/plugins/auto_completer/features/auto_complete.feature +7 -7
  40. data/plugins/auto_completer/features/step_definitions/auto_complete_steps.rb +3 -1
  41. data/plugins/auto_completer/features/step_definitions/dependency_steps.rb +0 -0
  42. data/plugins/auto_indenter/features/java_style_indentation.feature +5 -3
  43. data/plugins/auto_indenter/features/ruby_style_indentation.feature +13 -13
  44. data/plugins/auto_indenter/features/step_definitions/indentation_steps.rb +3 -1
  45. data/plugins/auto_indenter/spec/auto_indenter/analyzer_spec.rb +1 -1
  46. data/plugins/auto_indenter/spec/spec_helper.rb +1 -5
  47. data/plugins/auto_pairer/features/auto_pairer.feature +1 -1
  48. data/plugins/comment/features/line_comment.feature +31 -26
  49. data/plugins/comment/features/selection_comment.feature +1 -1
  50. data/plugins/comment/features/step_definitions/comment_steps.rb +6 -2
  51. data/plugins/comment/vendor/comment_lib.json +2 -0
  52. data/plugins/core/lib/core.rb +26 -0
  53. data/plugins/core/spec/core/base_storage_spec.rb +1 -1
  54. data/plugins/core/spec/core/gui_spec.rb +1 -1
  55. data/plugins/core/spec/core/observable_spec.rb +2 -1
  56. data/plugins/core/spec/core/persistent_cache_spec.rb +1 -1
  57. data/plugins/core/spec/core/shared_storage_spec.rb +1 -1
  58. data/plugins/core/spec/core/storage_spec.rb +1 -1
  59. data/plugins/core/spec/core/task_queue_spec.rb +1 -3
  60. data/plugins/core/spec/spec_helper.rb +1 -4
  61. data/plugins/declarations/spec/declarations/file_spec.rb +1 -1
  62. data/plugins/declarations/spec/spec_helper.rb +1 -5
  63. data/plugins/document_search/features/find.feature +39 -39
  64. data/plugins/document_search/features/step_definitions/find_steps.rb +6 -2
  65. data/plugins/edit_view/features/align_assignment.feature +6 -82
  66. data/plugins/edit_view/features/case_change.feature +22 -22
  67. data/plugins/edit_view/features/cursor_navigation.feature +2 -2
  68. data/plugins/edit_view/features/cut_and_paste.feature +9 -9
  69. data/plugins/edit_view/features/indentation_commands.feature +8 -8
  70. data/plugins/edit_view/features/line_delimiter.feature +7 -7
  71. data/plugins/edit_view/features/multiple_windows.feature +48 -48
  72. data/plugins/edit_view/features/step_definitions/dependency_steps.rb +0 -0
  73. data/plugins/edit_view/features/step_definitions/editing_steps.rb +237 -127
  74. data/plugins/edit_view/features/step_definitions/grammar_steps.rb +5 -1
  75. data/plugins/edit_view/features/step_definitions/notebook_steps.rb +38 -24
  76. data/plugins/edit_view/features/step_definitions/tab_steps.rb +83 -45
  77. data/plugins/edit_view/features/step_definitions/window_steps.rb +75 -54
  78. data/plugins/edit_view/features/support/env.rb +4 -23
  79. data/plugins/edit_view/lib/edit_view/commands/align_assignment_command.rb +29 -30
  80. data/plugins/edit_view/lib/edit_view/document.rb +23 -0
  81. data/plugins/edit_view/spec/edit_view/commands/align_assignment_command_spec.rb +83 -0
  82. data/plugins/edit_view/spec/edit_view/document/indentation_spec.rb +1 -1
  83. data/plugins/edit_view/spec/edit_view/document_spec.rb +1 -1
  84. data/plugins/edit_view/spec/spec_helper.rb +1 -4
  85. data/plugins/edit_view_swt/spec/edit_view_swt/word_movement_spec.rb +1 -1
  86. data/plugins/edit_view_swt/spec/spec_helper.rb +1 -4
  87. data/plugins/html_view/features/fixtures/sample.html +1 -1
  88. data/plugins/html_view/features/step_definitions/html_view_steps.rb +40 -39
  89. data/plugins/java/features/syntax_check_java.feature +18 -16
  90. data/plugins/line_tools/features/step_definitions/line_tools_steps.rb +18 -6
  91. data/plugins/macros/features/block_selection_in_macros.feature +47 -47
  92. data/plugins/macros/features/step_definitions/macro_steps.rb +9 -3
  93. data/plugins/macros/features/step_definitions/prediction_steps.rb +6 -2
  94. data/plugins/macros/plugin.rb +2 -1
  95. data/plugins/macros/spec/macros/predictive/sequence_finder_spec.rb +1 -1
  96. data/plugins/macros/spec/spec_helper.rb +1 -6
  97. data/plugins/outline_view/features/outline_view.feature +5 -5
  98. data/plugins/outline_view/features/step_definitions/outline_steps.rb +29 -17
  99. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +1 -1
  100. data/plugins/project/features/close_directory_tree.feature +0 -12
  101. data/plugins/project/features/open_directory_tree.feature +1 -2
  102. data/plugins/project/features/step_definitions/directory_steps.rb +13 -5
  103. data/plugins/project/features/step_definitions/file_steps.rb +23 -9
  104. data/plugins/project/features/step_definitions/find_file_steps.rb +6 -2
  105. data/plugins/project/features/step_definitions/project_tree_steps.rb +6 -2
  106. data/plugins/project/features/watch_for_modified_files.feature +1 -1
  107. data/plugins/project/spec/project/adapters/remote_protocols/ftp_spec.rb +1 -1
  108. data/plugins/project/spec/project/adapters/remote_protocols/sftp_spec.rb +1 -1
  109. data/plugins/project/spec/project/adapters/remote_spec.rb +1 -1
  110. data/plugins/project/spec/project/dir_mirror_spec.rb +1 -1
  111. data/plugins/project/spec/project/file_list_spec.rb +1 -1
  112. data/plugins/project/spec/project/file_mirror_spec.rb +2 -1
  113. data/plugins/project/spec/spec_helper.rb +1 -4
  114. data/plugins/project_search/spec/project_search/binary_data_detector_spec.rb +1 -1
  115. data/plugins/project_search/spec/project_search/word_search_spec.rb +1 -1
  116. data/plugins/project_search/spec/spec_helper.rb +1 -4
  117. data/plugins/{application → redcar}/features/navigation_history.feature +8 -8
  118. data/plugins/redcar/features/step_definitions/font_steps.rb +9 -5
  119. data/plugins/redcar/redcar.rb +0 -26
  120. data/plugins/repl/features/step_definitions/repl_steps.rb +15 -5
  121. data/plugins/repl/plugin.rb +1 -1
  122. data/plugins/repl/spec/repl/repl_mirror_spec.rb +1 -1
  123. data/plugins/repl/spec/spec_helper.rb +1 -4
  124. data/plugins/ruby/spec/ruby/repl_mirror_spec.rb +1 -1
  125. data/plugins/ruby/spec/spec_helper.rb +1 -5
  126. data/plugins/runnables/features/parameter_input.feature +43 -43
  127. data/plugins/runnables/features/step_definitions/runnable_steps.rb +9 -3
  128. data/plugins/runnables/plugin.rb +2 -2
  129. data/plugins/runnables/spec/runnables/output_processor_spec.rb +1 -1
  130. data/plugins/runnables/spec/spec_helper.rb +1 -5
  131. data/plugins/scm_svn/features/add_and_commit.feature +1 -0
  132. data/plugins/scm_svn/features/checkout.feature +1 -0
  133. data/plugins/scm_svn/features/edit_and_index.feature +1 -0
  134. data/plugins/scm_svn/features/ignore_files.feature +1 -0
  135. data/plugins/scm_svn/features/merge.feature +1 -0
  136. data/plugins/scm_svn/features/resolve_conflict.feature +1 -0
  137. data/plugins/scm_svn/features/revert_and_delete.feature +1 -0
  138. data/plugins/scm_svn/features/step_definitions/branch_and_merge_steps.rb +14 -9
  139. data/plugins/scm_svn/features/support/env.rb +4 -4
  140. data/plugins/scm_svn/features/switch_branches.feature +1 -0
  141. data/plugins/scm_svn/features/update.feature +1 -0
  142. data/plugins/strip_trailing_spaces/features/strip_trailing_spaces.feature +4 -4
  143. data/plugins/test_runner/plugin.rb +3 -1
  144. data/plugins/test_runner/spec/run_test_command_spec.rb +58 -50
  145. data/plugins/test_runner/spec/spec_helper.rb +1 -5
  146. data/plugins/textmate/features/step_definitions/tree_steps.rb +2 -0
  147. data/plugins/todo_list/features/todo_list.feature +1 -1
  148. data/plugins/todo_list/spec/spec_helper.rb +1 -4
  149. data/plugins/todo_list/spec/todo_list/file_parser_spec.rb +1 -1
  150. data/plugins/tree_view_swt/lib/tree_view_swt.rb +2 -1
  151. data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +1 -1
  152. metadata +48 -48
  153. data/lib/redcar/installer.rb +0 -178
  154. data/plugins/key_bindings/spec/spec_helper.rb +0 -5
  155. data/plugins/scm/spec/spec_helper.rb +0 -5
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Application do
4
4
  it "has a name" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Clipboard do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  class Redcar::Command
4
4
  describe Executor do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Command::History do
4
4
  class HistoryTestCommand1 < Redcar::Command
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Command do
4
4
  describe "a command" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe "Redcar::Keymap::Builder DSL" do
4
4
  it "creates a keymap" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe "Redcar::Menu::Builder DSL" do
4
4
  it "creates a menu" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Menu::Item do
4
4
  class DummyCommand; end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Menu do
4
4
  class DummyCommand; end
@@ -1,3 +1,5 @@
1
+ require "spec_helper"
2
+
1
3
  describe Redcar::NavigationHistory do
2
4
  module NavigationHistoryTest
3
5
  class TestEditView
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Notebook do
4
4
  describe "with no tabs" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Sensitive do
4
4
  class ExampleModel
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Speedbar do
4
4
  it "should let you add labels" do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Treebook do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Window do
4
4
 
@@ -1,8 +1,4 @@
1
- $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
- require 'redcar'
3
- Redcar.environment = :test
4
- Redcar.no_gui_mode!
5
- Redcar.load_unthreaded
1
+
6
2
  Dir[File.dirname(__FILE__) + "/application/controllers/*.rb"].each do |fn|
7
3
  require fn
8
4
  end
@@ -15,4 +11,6 @@ class MockTree
15
11
  end
16
12
 
17
13
  def focus; end
18
- end
14
+ end
15
+
16
+ Redcar.plugin_manager.load("application")
@@ -18,7 +18,7 @@ module Redcar
18
18
  layout = Swt::Layout::RowLayout.new(Swt::SWT::VERTICAL)
19
19
  composite.setLayout(layout)
20
20
 
21
- @text = Swt::Widgets::Text.new(composite, Swt::SWT::SINGLE | Swt::SWT::LEFT | Swt::SWT::ICON_CANCEL)
21
+ @text = Swt::Widgets::Text.new(composite, Swt::SWT::SINGLE | Swt::SWT::LEFT | Swt::SWT::ICON_CANCEL | Swt::SWT::SEARCH)
22
22
  @text.set_layout_data(Swt::Layout::RowData.new(400, 20))
23
23
  @list = Swt::Widgets::List.new(composite, Swt::SWT::V_SCROLL | Swt::SWT::H_SCROLL | Swt::SWT::SINGLE)
24
24
  @list.set_layout_data(Swt::Layout::RowData.new(400, 200))
@@ -24,9 +24,9 @@ module Redcar
24
24
  stops_with_implicit_zero.to_java(:int)
25
25
  end
26
26
 
27
- def swt_colors
27
+ def colors
28
28
  hex_rgb_strings = @color_stops.sort.map { |position, color| color }
29
- swt_colors = hex_rgb_strings.map do |hex_rgb_string|
29
+ colors = hex_rgb_strings.map do |hex_rgb_string|
30
30
  if hex_rgb_string =~ /^ (\W+)? ([0-9A-Fa-f]{3}{1,2}) (\W+)? $/x
31
31
  hex_string = Regexp.last_match.captures[1]
32
32
  if(hex_string.size == 3) # Shorthand
@@ -35,17 +35,27 @@ module Redcar
35
35
 
36
36
  color_components = hex_string.scan(/.{2}/)
37
37
  int_components = color_components.map { |component| component.to_i(16) }
38
- Swt::Graphics::Color.new(ApplicationSWT.display, *int_components[0...3])
38
+ [:components, int_components[0...3]]
39
39
 
40
40
  elsif Swt::SWT.const_defined?(const_name = "COLOR_#{ hex_rgb_string.upcase }")
41
41
  swt_const = Swt::SWT.const_get(const_name)
42
- ApplicationSWT.display.get_system_color(swt_const)
42
+ [:constant, swt_const]
43
43
 
44
44
  else
45
45
  raise "Colors must be RGB hex strings or SWT color names"
46
46
  end
47
47
  end
48
-
48
+ end
49
+
50
+ def swt_colors
51
+ swt_colors = colors.map do |color|
52
+ case color.first
53
+ when :components
54
+ Swt::Graphics::Color.new(ApplicationSWT.display, *color.last)
55
+ when :constant
56
+ ApplicationSWT.display.get_system_color(color.last)
57
+ end
58
+ end
49
59
  swt_colors.to_java(Swt::Graphics::Color)
50
60
  end
51
61
 
@@ -173,7 +173,7 @@ module Redcar
173
173
  end
174
174
 
175
175
  def icon_file
176
- if Redcar::VERSION =~ /dev$/
176
+ if Redcar::VERSION =~ /dev$/ and !ARGV.include?("--red-icon")
177
177
  :redcar_icon_beta_dev
178
178
  else
179
179
  :redcar_icon_beta
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::ApplicationSWT::Gradient do
4
4
 
@@ -28,9 +28,9 @@ describe Redcar::ApplicationSWT::Gradient do
28
28
  describe "swt_colors" do
29
29
 
30
30
  it "should be Swt::Color versions of the gradient colors in increasing order by stop position" do
31
- subject.swt_colors[0].should == Swt::Graphics::Color.new(Redcar::ApplicationSWT.display, 255, 255, 255)
32
- subject.swt_colors[1].should == Swt::Graphics::Color.new(Redcar::ApplicationSWT.display, 153, 153, 153)
33
- subject.swt_colors[2].should == Swt::Graphics::Color.new(Redcar::ApplicationSWT.display, 0, 0, 0)
31
+ subject.colors[0].should == [:components, [255, 255, 255]]
32
+ subject.colors[1].should == [:components, [153, 153, 153]]
33
+ subject.colors[2].should == [:components, [0, 0, 0]]
34
34
  end
35
35
 
36
36
  end
@@ -50,9 +50,9 @@ describe Redcar::ApplicationSWT::Gradient do
50
50
  describe "swt_colors" do
51
51
 
52
52
  it "should have the gradient's first color as its first two elements" do
53
- first_color = Swt::Graphics::Color.new(Redcar::ApplicationSWT.display, 0, 0, 0)
54
- subject.swt_colors[0].should == first_color
55
- subject.swt_colors[1].should == first_color
53
+ first_color = [:components, [0, 0, 0]]
54
+ subject.colors[0].should == first_color
55
+ subject.colors[1].should == first_color
56
56
  end
57
57
 
58
58
  end
@@ -74,9 +74,9 @@ describe Redcar::ApplicationSWT::Gradient do
74
74
  describe "swt_colors" do
75
75
 
76
76
  it "should have the gradient's last color as its last two elements" do
77
- last_color = Swt::Graphics::Color.new(Redcar::ApplicationSWT.display, 255, 255, 255)
78
- subject.swt_colors[1].should == last_color
79
- subject.swt_colors[2].should == last_color
77
+ last_color = [:components, [255, 255, 255]]
78
+ subject.colors[1].should == last_color
79
+ subject.colors[2].should == last_color
80
80
  end
81
81
 
82
82
  end
@@ -104,7 +104,7 @@ describe Redcar::ApplicationSWT::Gradient do
104
104
  subject { Redcar::ApplicationSWT::Gradient.new( 50 => "#F0F" ) }
105
105
 
106
106
  it "should process the colors correctly" do
107
- subject.swt_colors[0].should == Swt::Graphics::Color.new(Redcar::ApplicationSWT.display, 255, 0, 255)
107
+ subject.colors[0].should == [:components, [255, 0, 255]]
108
108
  end
109
109
 
110
110
  end
@@ -114,7 +114,7 @@ describe Redcar::ApplicationSWT::Gradient do
114
114
  subject { Redcar::ApplicationSWT::Gradient.new( "#FFFFFF" ) }
115
115
 
116
116
  it "it should construct a gradient with that color" do
117
- subject.swt_colors[0].should == Swt::Graphics::Color.new(Redcar::ApplicationSWT.display, 255, 255, 255)
117
+ subject.colors[0].should == [:components, [255, 255, 255]]
118
118
  end
119
119
 
120
120
  end
@@ -124,8 +124,7 @@ describe Redcar::ApplicationSWT::Gradient do
124
124
  subject { Redcar::ApplicationSWT::Gradient.new( "black" ) }
125
125
 
126
126
  it "should return the SWT system color corresponding to that name" do
127
- Redcar::ApplicationSWT.instance_variable_set("@display", Swt::Widgets::Display.current) if Redcar::ApplicationSWT.display.nil?
128
- subject.swt_colors[0].should == Redcar::ApplicationSWT.display.get_system_color(Swt::SWT::COLOR_BLACK)
127
+ subject.colors[0].should == [:constant, Swt::SWT::COLOR_BLACK]
129
128
  end
130
129
 
131
130
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  BindingTranslator = Redcar::ApplicationSWT::Menu::BindingTranslator
4
4
  describe BindingTranslator do
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::ApplicationSWT::Menu do
4
4
  it "should" do
@@ -1,20 +1,2 @@
1
- $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
-
3
- require 'redcar'
4
- Redcar.environment = :test
5
- Redcar.load_unthreaded
6
-
7
- Spec::Runner.configure do |config|
8
- config.before(:suite) do
9
- end
10
-
11
- config.before(:each) do
12
- end
13
-
14
- config.after(:each) do
15
- end
16
-
17
- config.after(:suite) do
18
- end
19
- end
20
1
 
2
+ Redcar.plugin_manager.load("application_swt")
@@ -3,21 +3,21 @@ Feature: Auto Complete
3
3
  Scenario: Autocomplete with no completions
4
4
  When I open a new edit tab
5
5
  And I replace the contents with "Tess"
6
- And I move the cursor to 4
6
+ And I move the cursor to (0,4)
7
7
  And I auto-complete
8
8
  Then I should see "Tess" in the edit tab
9
9
 
10
10
  Scenario: Autocomplete with one completions
11
11
  When I open a new edit tab
12
12
  And I replace the contents with "Daly Da"
13
- And I move the cursor to 7
13
+ And I move the cursor to (0,7)
14
14
  And I auto-complete
15
15
  Then I should see "Daly Daly" in the edit tab
16
16
 
17
17
  Scenario: Autocomplete with one completions, twice
18
18
  When I open a new edit tab
19
19
  And I replace the contents with "Daly Da"
20
- And I move the cursor to 7
20
+ And I move the cursor to (0,7)
21
21
  And I auto-complete
22
22
  And I auto-complete
23
23
  Then I should see "Daly Da" in the edit tab
@@ -26,14 +26,14 @@ Feature: Auto Complete
26
26
  Scenario: Autocomplete with two completions
27
27
  When I open a new edit tab
28
28
  And I replace the contents with "Dan Daly Da"
29
- And I move the cursor to 11
29
+ And I move the cursor to (0,11)
30
30
  And I auto-complete
31
31
  Then I should see "Dan Daly Daly" in the edit tab
32
32
 
33
33
  Scenario: Autocomplete with two completions, twice
34
34
  When I open a new edit tab
35
35
  And I replace the contents with "Dan Daly Da"
36
- And I move the cursor to 11
36
+ And I move the cursor to (0,11)
37
37
  And I auto-complete
38
38
  And I auto-complete
39
39
  Then I should see "Dan Daly Dan" in the edit tab
@@ -41,7 +41,7 @@ Feature: Auto Complete
41
41
  Scenario: Autocomplete with two completions, thrice
42
42
  When I open a new edit tab
43
43
  And I replace the contents with "Dan Daly Da"
44
- And I move the cursor to 11
44
+ And I move the cursor to (0,11)
45
45
  And I auto-complete
46
46
  And I auto-complete
47
47
  And I auto-complete
@@ -58,7 +58,7 @@ Feature: Auto Complete
58
58
  Scenario: Autocomplete with one completions at the end of a line
59
59
  When I open a new edit tab
60
60
  And I replace the contents with "Daly Da\nfoo"
61
- And I move the cursor to 7
61
+ And I move the cursor to (0,7)
62
62
  And I auto-complete
63
63
  Then I should see "Daly Daly\nfoo" in the edit tab
64
64
 
@@ -1,4 +1,6 @@
1
1
 
2
2
  When /I auto-complete/ do
3
- Redcar::AutoCompleter::AutoCompleteCommand.new.run
3
+ Swt.sync_exec do
4
+ Redcar::AutoCompleter::AutoCompleteCommand.new.run
5
+ end
4
6
  end
@@ -10,8 +10,9 @@ Feature: Indents Java code correctly
10
10
  """
11
11
  if(condition) {
12
12
  // stuff goes here...
13
- } <c>
13
+ }
14
14
  """
15
+ And I move the cursor to (2,4)
15
16
  When I type "e"
16
17
  Then the content should be:
17
18
  """
@@ -23,9 +24,10 @@ Feature: Indents Java code correctly
23
24
  Scenario: It should expand blocks
24
25
  Given the content is:
25
26
  """
26
- if(condition) {<c>}
27
+ if(condition) {}
27
28
  """
28
- When I insert "\n" at the cursor
29
+ And I move the cursor to (0,17)
30
+ When I type "\n"
29
31
  Then the content should be:
30
32
  """
31
33
  if(condition) {
@@ -6,32 +6,32 @@ Feature: Indents Ruby code correctly
6
6
  And tabs are hard
7
7
 
8
8
  Scenario: It should increase indentation after 'def's
9
- When I insert "def f" at the cursor
10
- And I move the cursor to 5
11
- And I insert "\n" at the cursor
9
+ Given I replace the contents with "def f"
10
+ And I move the cursor to (0,5)
11
+ And I type "\n"
12
12
  Then the contents should be "def f\n\t"
13
13
 
14
14
  Scenario: It should decrease indentation on 'end' line
15
- When I insert "def f\n\t1\n\ten" at the cursor
16
- And I move the cursor to 12
17
- And I insert "d" at the cursor
15
+ When I replace the contents with "def f\n\t1\n\ten"
16
+ And I move the cursor to (2,3)
17
+ And I type "d"
18
18
  Then the contents should be "def f\n\t1\nend"
19
19
 
20
20
  Scenario: It should keep indentation the same if no change
21
- When I insert "\tfoo" at the cursor
22
- And I move the cursor to 4
23
- And I insert "\n" at the cursor
21
+ When I replace the contents with "\tfoo"
22
+ And I move the cursor to (0,4)
23
+ And I type "\n"
24
24
  Then the contents should be "\tfoo\n\t"
25
25
 
26
26
  Scenario: It should autoindent correctly
27
- When I insert "\tdef my_awesome_method\n\t\tfoo\n\tend" at the cursor
28
- And I select from 0 to 33
27
+ When I replace the contents with "\tdef my_awesome_method\n\t\tfoo\n\tend"
28
+ And I select from (0,0) to (2,4)
29
29
  And I auto-indent
30
30
  Then the contents should be "def my_awesome_method\n\tfoo\nend"
31
31
 
32
32
  Scenario: It should autoindent correctly
33
- When I insert "\tdef my_awesome_method\n\t\tfoo\n\tend" at the cursor
34
- And I select from 0 to 33
33
+ When I replace the contents with "\tdef my_awesome_method\n\t\tfoo\n\tend"
34
+ And I select from (0,0) to (2,4)
35
35
  And I auto-indent
36
36
  Then the contents should be "def my_awesome_method\n\tfoo\nend"
37
37
  When I undo
@@ -11,5 +11,7 @@ Given /^the indentation rules are like Java's$/ do
11
11
  end
12
12
 
13
13
  When /^I auto-indent/ do
14
- Redcar::AutoIndenter::IndentCommand.new.run
14
+ Swt.sync_exec do
15
+ Redcar::AutoIndenter::IndentCommand.new.run
16
+ end
15
17
  end
@@ -1,5 +1,5 @@
1
1
 
2
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
2
+ require "spec_helper"
3
3
 
4
4
  include Redcar
5
5