Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

scaffold out specs

  • Loading branch information...
commit eee2a3b9a9f8e2ccf12b2657571994f320a8efce 1 parent e12bfb9
@sfaxon authored
View
1  Gemfile
@@ -5,4 +5,5 @@ gemspec
group :development do
gem 'ruby-debug19', :require => 'ruby-debug'
+ gem 'rspec'
end
View
5 Rakefile
@@ -1 +1,6 @@
require 'bundler/gem_tasks'
+require 'rake'
+
+Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
+
+task :default => :spec
View
9 spec/lib/amazon_spec.rb
@@ -0,0 +1,9 @@
+require 'spec_helper'
+
+describe RemoteBook::Amazon do
+
+ it "should return nil when setting doesn't exist" do
+ nil.should be_nil
+ end
+
+end
View
15 spec/spec_helper.rb
@@ -0,0 +1,15 @@
+# Requires supporting ruby files with custom matchers and macros, etc,
+# in spec/support/ and its subdirectories.
+# Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
+
+RSpec.configure do |config|
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
+end
View
34 tasks/spec.rake
@@ -0,0 +1,34 @@
+ENV['BUNDLE_GEMFILE'] = File.dirname(__FILE__) + '/../Gemfile'
+
+require 'rake'
+require 'rake/testtask'
+require 'rspec'
+require 'rspec/core/rake_task'
+
+desc "Run the test suite"
+task :spec => ['spec:setup', 'spec:remote_book_lib', 'spec:cleanup']
+
+namespace :spec do
+ desc "Setup the test environment"
+ task :setup do
+ end
+
+ desc "Cleanup the test environment"
+ task :cleanup do
+ end
+
+ desc "Test the remote_book library"
+ RSpec::Core::RakeTask.new(:remote_book_lib) do |task|
+ remote_book_root = File.expand_path(File.dirname(__FILE__) + '/..')
+ puts remote_book_root
+ task.pattern = remote_book_root + '/spec/lib/**/*_spec.rb'
+ end
+
+ desc "Run the coverage report"
+ RSpec::Core::RakeTask.new(:rcov) do |task|
+ remote_book_root = File.expand_path(File.dirname(__FILE__) + '/..')
+ task.pattern = remote_book_root + '/spec/lib/**/*_spec.rb'
+ task.rcov=true
+ task.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,features\/}
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.