diff --git a/spec/chef-rundeck_spec.rb b/spec/chef-rundeck_spec.rb index 678d978..62102ce 100644 --- a/spec/chef-rundeck_spec.rb +++ b/spec/chef-rundeck_spec.rb @@ -1,7 +1,13 @@ -require File.expand_path(File.dirname(__FILE__) + '/spec_helper') +require 'spec_helper' -describe "ChefRundeck" do - it "should respond to GET" do - get '/' +describe 'ChefRundeck' do + + it 'should return false' do + ChefRundeck.new + ChefRundeck.config_file = "#{ENV['TRAVIS_BUILD_DIR']}/spec/support/client.rb" + + get '/' + last_response.should be_ok end + end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d92b458..7409b79 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,19 +1,19 @@ $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'chef-rundeck' +require 'sinatra' require 'rspec' require 'rspec/autorun' require 'rack/test' -# setup test environment -# set :environment, :test -# set :run, false -# set :raise_errors, true -# set :logging, false + +set :environment, :test +set :run, false +set :raise_errors, true +set :logging, false def app ChefRundeck.new - ChefRundeck.config_file("#{ENV['TRAVIS_BUILD_DIR']}/spec/support/client.rb") end RSpec.configure do |config| diff --git a/spec/support/client.rb b/spec/support/client.rb index 6dcc8fd..9aa1f40 100644 --- a/spec/support/client.rb +++ b/spec/support/client.rb @@ -1,5 +1,5 @@ log_level :info log_location STDOUT chef_server_url "https://api.opscode.com/organizations/chef-rundeck" -client_key ENV["TRAVIS_BUILD_DIR"] + "/spec/support/travis.pem" +client_key "#{ENV["TRAVIS_BUILD_DIR"]}" + "/spec/support/travis.pem" node_name "travis"