Skip to content

Commit

Permalink
setting up travis
Browse files Browse the repository at this point in the history
  • Loading branch information
orieken committed Jul 1, 2012
1 parent b1bd7dc commit 7fc57f5
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
@@ -0,0 +1,11 @@
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start

script: "bundle exec HEADLESS=true rspec spec"
script: "bundle exec HEADLESS=true cucumber"

language: ruby
rvm:
- 1.8.7
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -6,6 +6,6 @@ gem 'watir-webdriver'
gem "watir", :platforms => [:mingw, :mswin]
gem 'selenium-webdriver'
gem 'i18n'

gem 'headless'

gem 'pry'
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -38,6 +38,7 @@ GEM
json (>= 1.4.6)
gherkin (2.11.1-x86-mingw32)
json (>= 1.4.6)
headless (0.3.1)
hoe (3.0.6)
rake (~> 0.8)
i18n (0.6.0)
Expand Down Expand Up @@ -111,6 +112,7 @@ PLATFORMS

DEPENDENCIES
cucumber
headless
i18n
pry
selenium-webdriver
Expand Down
10 changes: 10 additions & 0 deletions features/support/env.rb
Expand Up @@ -11,6 +11,16 @@

(ENV['BROWSER'] ||= 'firefox').downcase

#option HEADLESS=true
if ENV['HEADLESS']
require 'headless'
headless = Headless.new
headless.start
at_exit do
headless.destroy
end
end

module Taza
class Browser
def self.create_watir_webdriver(params)
Expand Down
6 changes: 6 additions & 0 deletions rakefile
@@ -1,6 +1,8 @@
#Generated at Tue Aug 16 01:18:07 -0300 2011
require 'rubygems'
require 'taza/tasks'
require 'cucumber'
require 'cucumber/rake/task'

Taza::Rake::Tasks.new do |t|
file_hole = FileUtils.mkdir_p "artifacts/#{Time.now.to_i}"
Expand All @@ -11,3 +13,7 @@ Taza::Rake::Tasks.new do |t|
"--color",
"--format FailingExamplesFormatter --out #{file_hole}/failing_examples.txt"]
end

Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format pretty"
end
12 changes: 11 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -10,7 +10,17 @@
lib_path = File.expand_path("#{File.dirname(__FILE__)}/../lib/sites")
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)

(ENV['BROWSER'] ||= 'chrome').downcase
(ENV['BROWSER'] ||= 'firefox').downcase

#option HEADLESS=true
if ENV['HEADLESS']
require 'headless'
headless = Headless.new
headless.start
at_exit do
headless.destroy
end
end

RSpec.configure do |config|
config.mock_with :mocha
Expand Down

0 comments on commit 7fc57f5

Please sign in to comment.