TS 68 Ruby Sanity

Ruby Sanity Test Specification for NetBeans 6.8

Author: Tomas Musil
Version: 1.0
Estimated time: ??
Comments: Ruby development documentation can be found here.

Contents


Test suite: Project Support

Purpose: Test project support (http://wiki.netbeans.org/wiki/view/RubyProjects).
Setup: Get IDE Ruby or install Ruby module (http://wiki.netbeans.org/wiki/view/RubyInstallation).

  1. New Project wizard
    1. Open New Project wizard
    2. Select Ruby category
    3. Select Ruby Application project
    4. Click Next and browse for project location (e.g. c:\work)
    5. Click Manage and open Gem Manager
    6. Close both Ruby Gems and Ruby Platform Manager windows
    7. Check all your ruby platforms are listed in Ruby Platform combo box
    8. Finish the wizard
    9. Check a new Ruby project is created and opened, there are Source Files and Test Files, main.rb under Source Files, Rakefile.rb in project root, main.rb is opened in the editor.
    • EXPECTED RESULT: All actions are executed sucessfully.
  2. New File wizard
    1. Open New File wizard
    2. Select Ruby category
    3. Select Ruby Class file
    4. Type something into In Module text field
    5. Type something into Extends text field
    6. Click Finish to finish the wizard
    7. Check module and extends parameters are taken into account
    8. Repeat for this file types (RHTLM File, ERB File, Ruby File, Ruby Unit Test).
    • EXPECTED RESULT: Check appropriate file is created in given location and it is opened in the editor.
  3. Project properties
    1. Add some arguments, change main ruby script to e.g. new_main.rb
    2. Type puts ARGV in new_main.rb and run project
    • EXPECTED RESULT: All changed parameters are stored and taken into account. new_main.rb is executed when you run project, args are printed.
  4. Project actions
    1. Call Build Project and check default task is executed
    2. Call Clean and Build Project and check both tasks are executed
    3. Call Run Project and check that main script is executed
    4. Call Rename Project
      1. Change name in Rename Project dialog and click Rename
      2. Check project is renamed
      3. Repeat action but check 'Also Rename Project Folder' checkbox and click Rename
      4. Check project is renamed and folder as well
    5. Call Move Project, select different location, confirm the dialog and check project is moved
    6. Call Copy Project, confirm the dialog and check project is copied and opened in IDE
    7. Call Close Project and check project is not shown in Projects view
    8. Open project again using File|Open Recent Project main menu item
    9. Call Delete Project, check 'Delete Sources' checkbox, confirm the dialog and verify project is closed and deleted (issue 99928)
    • EXPECTED RESULT: All actions are executed sucessfully.
  5. Run single Ruby file
    1. Open main.rb in the editor
    2. Call context menu Run
    3. Select main.rb node
    4. Call main menu Run|Run File|Run "main.rb"
    5. Select main.rb node
    6. Press Shift+F6
    7. Call Run File action on main.rb node (issue 91402)
    8. Go to output view and click double arrow button to rerun file
    9. Add 'sleep(10)' to main.rb, run it and click stop button in output view
    • EXPECTED RESULT: It is possible to execute single file all possible ways.
  6. Unit Tests
  7. Ruby Shell (IRB)
    1. Click main menu item 'Window|Other|Ruby Shell (IRB)'
    2. Type some statements in (e.g. x=1 Enter y=2 Enter puts(x+y) Enter)
    • EXPECTED RESULT: Commands are executed succesfully.
  8. Ruby Platform Manager
    1. Open Tools|Ruby Platforms
    2. Check all your ruby platforms are in the list
    3. Select a platform and click Remove button
    4. Click Autodetect Platforms and check removed platform is added
    5. Click Add Platform
    6. Browse for different platform
    7. Check platform is added
    8. Open project properties
    9. Select Run category
    10. Choose other platform in the Ruby Platform combo box
    11. Add -v to Ruby options
    12. Close properties dialog box
    13. Run main.rb file and check correct ruby platform is displayed
    14. Change platform in project properties, run main.rb and check again
    • EXPECTED RESULT: All actions are executed sucessfully.
  9. Ruby Gems Manager (http://wiki.netbeans.org/wiki/view/RubyGems)
    1. Open 'Tools|Ruby Gems'
    2. Select some gem and install it
    3. use this gem in source file (require 'myinstalledgem')
    4. check that file is executed properly
    5. uninstall gem
    6. check that file cannot be executed properly now
    • EXPECTED RESULT: It is possible to install and uninstall gems.


Test suite: Editing Support

Purpose: Test editing support (http://wiki.netbeans.org/wiki/view/RubyEditing).
Setup: create new ruby project, main.rb is opened

  1. Syntax highlighting and semantic syntax highlighting
    1. paste into main.rb content of this file
    2. check if highlighting is ok, compare to the attached highlighting.png
    • EXPECTED RESULT: Every element is highlighted correctly.
  2. Code Completion
    1. create new ruby class file
    2. remove everything
    3. type req , press ctrl+space and press enter -> require is written
    4. type da , press ctrl+space again and press enter twice-> date
    5. at new line type Da , press ctrl + space, select Date , look at rdoc, press enter, type . so Date. is written, press ctrl+space, type to , press enter, press backspace, press enter -> Date.today()
    6. at new line type  % and press ctrl+space, you can choose from several letters ( for example %x(ls) execute in linux external command ls and return its result )
    7. at new line type "\ and press ctrl+space , you have some choices
    8. at new line type / ( /this_is_regular_expression/ )
    9. press ctrl+space and code completion will help you with regular expressions syntax
    10. by typing $ and pressing ctrl+space code completion remember you what dollar variables you can use
    • EXPECTED RESULT: everything works correctly
  3. Go To Declaration
    1. click on date
    2. go to declaration using:
      1. CTRL + B
      2. right click on date and call Navigate|Go to Declaration
      3. press CTRL + left click on date
    • EXPECTED RESULT: data.rb source file is opened.
  4. Instant Rename
    1. open main.rb
    2. click arg1 variable name and second occurence is highlighted too
    3. call Rename context menu item in editor (or press Ctrl+R)
    4. both highlighted words are blue
    5. type new name for variable and press enter
    • EXPECTED RESULT: variable is renamed everywhere
  5. Pair Matching
    1. check that editor automatically highlights matching parentheses, braces, brackets, string delimiters, regular expression delimiters, etc.
    2. type def hello , press enter end is automaticaly written
    3. type ( , automaticaly () is written, if you type closing ) , it removes the previous )
    4. that works for { too
    5. type for something press enter, an "end" statement is automatically inserted
    • EXPECTED RESULT: worked as discribed
  6. Mark Occurrences
    1. open main.rb
    2. click on localvar and check all occurences are highlighted
    3. click hello(1) and check all occurencies of hello method with one parameter are highlighted
    4. click hello(1, 2) and check all occurencies of hello method with two parameters are highlighted
    5. click &block in hello1 method and check &block in method body is also highlighted (issue 129606)
    • EXPECTED RESULT: works as expected
  7. Refactoring
    1. open main.rb
    2. call Find Usages context menu item on hello method in editor
    3. click Find button in Find Usages dialog and check results in Usages output tab
    4. double-click every occurence and check it opens appropriate position in editor
    5. call Refactor|Rename context menu item on hello method in editor
    6. type hello_new in Rename Method dialog and click Preview button
    7. check changes in Refactoring preview window and click Do Refactoring button
    8. check changes in editor
    • EXPECTED RESULT: Everything works as expected.


Test suite: Ruby on Rails

Purpose: Test Ruby on Rails (http://wiki.netbeans.org/wiki/view/RubyOnRails).
Setup:

  1. New RoR Project wizard
    1. Open New Project wizard
    2. Select Ruby category
    3. Select Ruby On Rails Application project
    4. Click Next and fill the Project Name
    5. Click Manage and close Ruby Platform Manager
    6. Click Next twice and Update Rails (issue 130496)
    7. Click Install JRuby OpenSSL Support
    8. Click Proxy Settings and close options
    9. Finish the wizard
    • EXPECTED RESULT: Check a new Ruby On Rails project is created and opened, there are Controllers, Helpers, Models, Views, Configuration, Database Migrations, Libs, Logs, Public, RSpec, Unit Tests, Functional Tests, Test Fixtures, Test Mocks, Integration Tests, Scripts, Documentation and Vendor folders
  2. New RoR Project wizard - Database Connection (http://wiki.netbeans.org/RubyDatabaseIntegration)
    1. Open New Project wizard
    2. Select Ruby category
    3. Select Ruby On Rails Application project
    4. Click Next twice to get to Database Configuration panel
    5. Click Create DB button
    6. Fill path to start DB (e.g. MySQL Server 5.0\bin\mysqld.exe) and path to stop DB (e.g. MySQL Server 5.0\bin\mysqladmin.exe with -u root shutdown parameters)
    7. Type database name in Create Database dialog and click OK
    8. Confirm New Database Connection dialog and finish the wizard
    9. Check database is created and parameters in database.yml are correct
    10. Open new wizard at Database Configuration panel again
    11. Pick Specify Database Information Directly radio button
    12. Fill in text fields and finish the wizard
    13. Check parameters in database.yml are correct
    14. Repeat again but check Access Dataabse Using JDBC check box
    15. Finish wizard and check parameters in database.yml
  3. Project actions
    1. Call Run Project
    • EXPECTED RESULT: Server is started and localhost:3000 is acessible from browser.
  4. Rails Generator
    1. Call 'Generate' popup action on Controllers node, check 'Rails generator' dialog is opened and 'controller' is selected in combo box
    2. Click 'Install Generators...' button and check 'Ruby Gems' dialog is opened
    3. Close the dialog
    4. Type myapp in the Name text field
    5. Check 'Preview Changes only' check box and click OK
    6. Check preview is printed to console but nothing is created
    7. Open Rails Generator again
    8. Uncheck Preview check box
    9. Type myapp in the Name text field and myview in View text field
    10. Click OK and check myview.rhtml, myapp_helper.rb, myapp_controller_test.rb and myapp_controller.rb files are created and opened in editor
  5. Run single file
    1. Open Configuration|environment.rb
    2. Put
       config.frameworks -= [:active_record ] 
      under Rails::Initializer.run block
    3. Open myview.html.erb in the editor
    4. Call context menu Run in editor
    5. Go to Services view, expand Servers node, expand WEBrick node, call Stop action on RailsApplication
    6. Select Views|myapp|myview.html.erb node
    7. Call main menu Run|Run File|Run "myview.html.erb"
    8. Select Views|myapp|myview.html.erb node
    9. Press Shift+F6
    10. Click x button in progress bar and confirm Cancel Running Task dialog to stop WEBrick server
    • EXPECTED RESULT: WEBrick server is started and default browser is opened at myapp/myview context.
  6. Go to Rails Action or View
    1. Open myview.html.erb file in the editor
    2. Call context menu 'Navigate|Go to Rails Action or View'
    3. Check myapp_controller.rb is opened in the editor
    4. Call context menu 'Navigate|Go to Rails Action or View'
    5. Check myview.html.erb is opened in the editor
    • EXPECTED RESULT: Action is available and works correctly.
  7. RHTML files
    1. Open myview.html.erb in the editor
    2. Type lia and press Tab to expand
    3. Type Refresh , press enter, type myview , press enter
    4. It should look like Type
      <%= link_to "Refresh", :action => "myview" %>
    5. Check syntax highlighting
    6. You can look at one of tutorials for bigger RHTML file
    7. Type
      <%= Date.to
    8. Press CTRL+Space to invoke code completion
    9. Check it offers
      today
    10. Type
      <table border="<%= Tim
    11. Invoke code completion and check it (issue 104246)
    12. Complete code to this state
      <table border="<%= Time.now.sec %>" cellpa
      (issue 130009)
    13. Invoke HTML code completion
    14. Check it offers
      cellpadding
    15. Complete code
      <table border="<%= Time.now.sec %>" cellpadding="1">
    16. Check syntax coloring
    17. Hold Ctrl and click Time to go to declaration
    18. Select from options and check it is opened in editor
    • EXPECTED RESULT: Everything works correctly.


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo