From 511dfa23af2f2498612288eb33da20c6d3bf6a4f Mon Sep 17 00:00:00 2001 From: Andrew Spinks Date: Sat, 31 Mar 2012 16:38:16 +1100 Subject: [PATCH] add rspec --- .rspec | 1 + Gemfile | 3 +++ Gemfile.lock | 21 ++++++++++++++++++++- spec/spec_helper.rb | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .rspec create mode 100644 spec/spec_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 0000000000..53607ea52b --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--colour diff --git a/Gemfile b/Gemfile index 35beb4c69e..4b9bba0848 100644 --- a/Gemfile +++ b/Gemfile @@ -45,5 +45,8 @@ gem 'jquery-rails' group :test do # Pretty printed test output gem 'turn', '~> 0.8.3', :require => false + gem 'rspec-rails' + gem 'shoulda-matchers' + gem 'machinist' end diff --git a/Gemfile.lock b/Gemfile.lock index f09f494c37..92ce6878f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/spree/spree_i18n.git - revision: 1aef1d10a65027db7c28119da38213ba3dab9a03 + revision: 757d0ee7b76a74f86fb9f8474b8fdd7d17fb946e specs: spree_i18n (1.0.0) spree_core (>= 0.30.0) @@ -72,6 +72,7 @@ GEM bcrypt-ruby (~> 3.0) orm_adapter (~> 0.0.3) warden (~> 1.0.3) + diff-lcs (1.1.3) erubis (2.7.0) execjs (1.3.0) multi_json (~> 1.0) @@ -92,6 +93,7 @@ GEM activesupport (>= 3.0.0) railties (>= 3.0.0) kgio (2.7.4) + machinist (2.0) mail (2.3.3) i18n (>= 0.4.0) mime-types (~> 1.16) @@ -148,6 +150,19 @@ GEM rake (0.9.2.2) rdoc (3.12) json (~> 1.4) + rspec (2.9.0) + rspec-core (~> 2.9.0) + rspec-expectations (~> 2.9.0) + rspec-mocks (~> 2.9.0) + rspec-core (2.9.0) + rspec-expectations (2.9.0) + diff-lcs (~> 1.1.3) + rspec-mocks (2.9.0) + rspec-rails (2.9.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec (~> 2.9.0) sass (3.1.15) sass-rails (3.1.6) actionpack (~> 3.1.0) @@ -162,6 +177,7 @@ GEM nokogiri (>= 1.4.0) nori (~> 1.1) wasabi (~> 2.1) + shoulda-matchers (1.0.0) spree (1.0.2) spree_api (= 1.0.2) spree_auth (= 1.0.2) @@ -236,9 +252,12 @@ PLATFORMS DEPENDENCIES coffee-rails (~> 3.1.1) jquery-rails + machinist pg rails (= 3.1.4) + rspec-rails sass-rails (~> 3.1.5) + shoulda-matchers spree spree_i18n! spree_skrill diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000000..e66d9802c1 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,32 @@ +# This file is copied to spec/ when you run 'rails generate rspec:install' +ENV["RAILS_ENV"] ||= 'test' +require File.expand_path("../../config/environment", __FILE__) +require 'rspec/rails' +require 'rspec/autorun' + +# 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} + +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 + + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # If true, the base class of anonymous controllers will be inferred + # automatically. This will be the default behavior in future versions of + # rspec-rails. + config.infer_base_class_for_anonymous_controllers = false +end