Class: Polonium::Tasks::PoloniumTestTask
- Inherits:
-
Object
- Object
- Polonium::Tasks::PoloniumTestTask
- Defined in:
- lib/polonium/tasks/selenium_test_task.rb
Instance Attribute Summary collapse
-
#rails_env ⇒ Object
readonly
Returns the value of attribute rails_env.
-
#rails_root ⇒ Object
readonly
Returns the value of attribute rails_root.
Instance Method Summary collapse
-
#initialize(rails_env = RAILS_ENV, rails_root = RAILS_ROOT) ⇒ PoloniumTestTask
constructor
A new instance of PoloniumTestTask.
- #invoke(suite_relative_path = "test/selenium/selenium_suite") ⇒ Object
Constructor Details
#initialize(rails_env = RAILS_ENV, rails_root = RAILS_ROOT) ⇒ PoloniumTestTask
Returns a new instance of PoloniumTestTask.
7 8 9 10 |
# File 'lib/polonium/tasks/selenium_test_task.rb', line 7 def initialize(rails_env = RAILS_ENV, rails_root = RAILS_ROOT) @rails_env = rails_env @rails_root = rails_root end |
Instance Attribute Details
#rails_env ⇒ Object (readonly)
Returns the value of attribute rails_env.
5 6 7 |
# File 'lib/polonium/tasks/selenium_test_task.rb', line 5 def rails_env @rails_env end |
#rails_root ⇒ Object (readonly)
Returns the value of attribute rails_root.
5 6 7 |
# File 'lib/polonium/tasks/selenium_test_task.rb', line 5 def rails_root @rails_root end |
Instance Method Details
#invoke(suite_relative_path = "test/selenium/selenium_suite") ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/polonium/tasks/selenium_test_task.rb', line 12 def invoke(suite_relative_path = "test/selenium/selenium_suite") rails_env.replace "test" require "#{rails_root}/" + suite_relative_path passed = Test::Unit::AutoRunner.run raise "Test failures" unless passed end |