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/runner.rb,
lib/evergreen/server.rb,
lib/evergreen/version.rb,
lib/evergreen/template.rb,
lib/evergreen/application.rb
Defined Under Namespace
Classes: Cli, Railtie, Runner, Server, Spec, Suite, Template
Constant Summary collapse
- VERSION =
'0.4.0.6'
Class Attribute Summary collapse
-
.driver ⇒ Object
Returns the value of attribute driver.
-
.public_dir ⇒ Object
Returns the value of attribute public_dir.
-
.spec_dir ⇒ Object
Returns the value of attribute spec_dir.
-
.template_dir ⇒ Object
Returns the value of attribute template_dir.
Class Method Summary collapse
- .application(suite) ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .rails ⇒ Object
- .use_defaults! ⇒ Object
Class Attribute Details
.driver ⇒ Object
Returns the value of attribute driver.
18 19 20 |
# File 'lib/evergreen.rb', line 18 def driver @driver end |
.public_dir ⇒ Object
Returns the value of attribute public_dir.
18 19 20 |
# File 'lib/evergreen.rb', line 18 def public_dir @public_dir end |
.spec_dir ⇒ Object
Returns the value of attribute spec_dir.
18 19 20 |
# File 'lib/evergreen.rb', line 18 def spec_dir @spec_dir end |
.template_dir ⇒ Object
Returns the value of attribute template_dir.
18 19 20 |
# File 'lib/evergreen.rb', line 18 def template_dir @template_dir end |
Class Method Details
.application(suite) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/evergreen/application.rb', line 2 def self.application(suite) Rack::Builder.new do map "/jasmine" do use Rack::Static, :urls => ["/"], :root => File.('../jasmine/lib', File.dirname(__FILE__)) run lambda { |env| [404, {}, "No such file"]} end map "/resources" do use Rack::Static, :urls => ["/"], :root => File.('resources', File.dirname(__FILE__)) run lambda { |env| [404, {}, "No such file"]} end map "/" do app = Class.new(Sinatra::Base).tap do |app| app.reset! app.class_eval do set :static, true set :root, File.('.', File.dirname(__FILE__)) set :public, File.(File.join(suite.root, Evergreen.public_dir), File.dirname(__FILE__)) helpers do def url(path) request.env['SCRIPT_NAME'].to_s + path.to_s end end get '/' do @suite = suite erb :list end get '/run/*' do |name| @suite = suite @spec = suite.get_spec(name) @js_spec_helper = suite.get_spec('spec_helper.js') @coffee_spec_helper = suite.get_spec('spec_helper.coffee') erb :spec end end end run app end end end |
.configure {|_self| ... } ⇒ Object
20 21 22 |
# File 'lib/evergreen.rb', line 20 def configure yield self end |
.rails ⇒ Object
5 6 7 |
# File 'lib/evergreen/rails.rb', line 5 def self.rails Evergreen::Suite.new(Rails.root).application end |
.use_defaults! ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/evergreen.rb', line 24 def use_defaults! configure do |config| config.driver = :selenium config.public_dir = 'public' config.spec_dir = 'spec/javascripts' config.template_dir = 'spec/javascripts/templates' end end |