Module: Evergreen
- Defined in:
- lib/evergreen.rb,
lib/evergreen/cli.rb,
lib/evergreen/spec.rb,
lib/evergreen/rails.rb,
lib/evergreen/suite.rb,
lib/evergreen/helper.rb,
lib/evergreen/runner.rb,
lib/evergreen/server.rb,
lib/evergreen/version.rb,
lib/evergreen/template.rb,
lib/evergreen/application.rb,
lib/evergreen/utils/timeout.rb
Defined Under Namespace
Classes: Application, Cli, Helper, Railtie, Runner, Server, Spec, Suite, Template
Constant Summary collapse
- VERSION =
'1.3.0'
Class Attribute Summary collapse
-
.application ⇒ Object
Returns the value of attribute application.
-
.driver ⇒ Object
Returns the value of attribute driver.
-
.helper_dir ⇒ Object
Returns the value of attribute helper_dir.
-
.mounted_at ⇒ Object
Returns the value of attribute mounted_at.
-
.public_dir ⇒ Object
Returns the value of attribute public_dir.
-
.root ⇒ Object
Returns the value of attribute root.
-
.spec_dir ⇒ Object
Returns the value of attribute spec_dir.
-
.spec_timeout ⇒ Object
Returns the value of attribute spec_timeout.
-
.template_dir ⇒ Object
Returns the value of attribute template_dir.
Class Method Summary collapse
- .configure {|_self| ... } ⇒ Object
-
.timeout(seconds = 1, error_message = nil, &block) ⇒ Object
Provides timeout similar to standard library Timeout, but avoids threads.
- .use_defaults! ⇒ Object
Class Attribute Details
.application ⇒ Object
Returns the value of attribute application.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def application @application end |
.driver ⇒ Object
Returns the value of attribute driver.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def driver @driver end |
.helper_dir ⇒ Object
Returns the value of attribute helper_dir.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def helper_dir @helper_dir end |
.mounted_at ⇒ Object
Returns the value of attribute mounted_at.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def mounted_at @mounted_at end |
.public_dir ⇒ Object
Returns the value of attribute public_dir.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def public_dir @public_dir end |
.root ⇒ Object
Returns the value of attribute root.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def root @root end |
.spec_dir ⇒ Object
Returns the value of attribute spec_dir.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def spec_dir @spec_dir end |
.spec_timeout ⇒ Object
Returns the value of attribute spec_timeout.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def spec_timeout @spec_timeout end |
.template_dir ⇒ Object
Returns the value of attribute template_dir.
20 21 22 |
# File 'lib/evergreen.rb', line 20 def template_dir @template_dir end |
Class Method Details
.configure {|_self| ... } ⇒ Object
22 23 24 |
# File 'lib/evergreen.rb', line 22 def configure yield self end |
.timeout(seconds = 1, error_message = nil, &block) ⇒ Object
Provides timeout similar to standard library Timeout, but avoids threads
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/evergreen/utils/timeout.rb', line 7 def timeout(seconds = 1, = nil, &block) start_time = Time.now result = nil until result return result if result = yield delay = seconds - (Time.now - start_time) if delay <= 0 raise TimeoutError, || "timed out" end sleep(0.05) end end |
.use_defaults! ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/evergreen.rb', line 26 def use_defaults! configure do |config| config.application = Evergreen::Application config.driver = :selenium config.public_dir = 'public' config.spec_dir = 'spec/javascripts' config.template_dir = 'spec/javascripts/templates' config.helper_dir = 'spec/javascripts/helpers' config.mounted_at = "" config.spec_timeout = 300 end end |