Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

setup rspec e vcr

  • Loading branch information...
commit 9e315d666549cb58c627157f4900a65fb723defa 1 parent 13ac7a3
@marcoshack marcoshack authored
View
1  .rspec
@@ -0,0 +1 @@
+--colour
View
12 Gemfile
@@ -37,3 +37,15 @@ gem 'jquery-rails'
# To use debugger
# gem 'debugger'
+
+group :development, :test do
+ gem 'rspec-rails'
+end
+
+group :test do
+ gem 'capybara'
+ gem 'vcr'
+ gem 'fakeweb'
+ gem 'capybara-mechanize'
+ gem 'guard-rspec'
+end
View
77 Gemfile.lock
@@ -28,8 +28,21 @@ GEM
activesupport (3.2.6)
i18n (~> 0.6)
multi_json (~> 1.0)
+ addressable (2.2.8)
arel (3.0.2)
builder (3.0.0)
+ capybara (1.1.2)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ capybara-mechanize (0.3.0)
+ capybara (~> 1.1)
+ mechanize (~> 2.3)
+ childprocess (0.3.3)
+ ffi (~> 1.0.6)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
@@ -38,9 +51,19 @@ GEM
execjs
coffee-script-source (1.3.3)
commonjs (0.2.6)
+ diff-lcs (1.1.3)
+ domain_name (0.5.3)
+ unf (~> 0.0.3)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
+ fakeweb (1.3.0)
+ ffi (1.0.11)
+ guard (1.2.3)
+ listen (>= 0.4.2)
+ thor (>= 0.14.6)
+ guard-rspec (1.1.0)
+ guard (>= 1.1)
hike (1.2.1)
hypertemplate (1.2.2)
json_pure
@@ -58,10 +81,24 @@ GEM
actionpack (>= 3.1)
less (~> 2.2.0)
libv8 (3.3.10.4)
+ libwebsocket (0.1.3)
+ addressable
+ listen (0.4.7)
+ rb-fchange (~> 0.0.5)
+ rb-fsevent (~> 0.9.1)
+ rb-inotify (~> 0.8.8)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
+ mechanize (2.5.1)
+ domain_name (~> 0.5, >= 0.5.1)
+ mime-types (~> 1.17, >= 1.17.2)
+ net-http-digest_auth (~> 1.1, >= 1.1.1)
+ net-http-persistent (~> 2.5, >= 2.5.2)
+ nokogiri (~> 1.4)
+ ntlm-http (~> 0.1, >= 0.1.1)
+ webrobots (~> 0.0, >= 0.0.9)
medie (1.0.0)
actionpack (>= 3.0.0)
activesupport
@@ -70,7 +107,10 @@ GEM
methodize (0.2.2)
mime-types (1.19)
multi_json (1.3.6)
+ net-http-digest_auth (1.2.1)
+ net-http-persistent (2.7)
nokogiri (1.5.5)
+ ntlm-http (0.1.1)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@@ -97,6 +137,11 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (0.9.2.2)
+ rb-fchange (0.0.5)
+ ffi
+ rb-fsevent (0.9.1)
+ rb-inotify (0.8.8)
+ ffi (>= 0.5.0)
rdoc (3.12)
json (~> 1.4)
respondie (0.9.0)
@@ -108,11 +153,30 @@ GEM
rack-conneg
respondie (~> 0.9.0)
sqlite3-ruby
+ rspec (2.10.0)
+ rspec-core (~> 2.10.0)
+ rspec-expectations (~> 2.10.0)
+ rspec-mocks (~> 2.10.0)
+ rspec-core (2.10.1)
+ rspec-expectations (2.10.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.10.1)
+ rspec-rails (2.10.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.10.0)
+ rubyzip (0.9.9)
sass (3.1.20)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
+ selenium-webdriver (2.24.0)
+ childprocess (>= 0.2.5)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
+ rubyzip
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -136,16 +200,29 @@ GEM
uglifier (1.2.6)
execjs (>= 0.3.0)
multi_json (~> 1.3)
+ unf (0.0.5)
+ unf_ext
+ unf_ext (0.0.5)
+ vcr (2.2.2)
+ webrobots (0.0.13)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
+ capybara
+ capybara-mechanize
coffee-rails (~> 3.2.1)
+ fakeweb
+ guard-rspec
jquery-rails
less-rails
rails (= 3.2.6)
restfulie (~> 1.0.0)
+ rspec-rails
sass-rails (~> 3.2.3)
twitter-bootstrap-rails
uglifier (>= 1.0.3)
+ vcr
View
24 Guardfile
@@ -0,0 +1,24 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rspec', :version => 2 do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
+
+ # Turnip features and steps
+ watch(%r{^spec/acceptance/(.+)\.feature$})
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
+end
+
View
32 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
View
4 spec/support/vcr.rb
@@ -0,0 +1,4 @@
+VCR.configure do |c|
+ c.cassette_library_dir = Rails.root.join("spec", "vcr")
+ c.stub_with :fakeweb
+end
Please sign in to comment.
Something went wrong with that request. Please try again.