Permalink
Browse files

RSpec configuration

  • Loading branch information...
dce committed Nov 27, 2012
1 parent 4820c71 commit b311b182f48e9534a6637943b4ff30148bd87601
Showing with 61 additions and 57 deletions.
  1. +4 −4 .gitignore
  2. +1 −0 .rspec
  3. +13 −0 Gemfile.lock
  4. +4 −12 Rakefile
  5. 0 {test → spec}/dummy/README.rdoc
  6. 0 {test → spec}/dummy/Rakefile
  7. 0 {test → spec}/dummy/app/assets/javascripts/application.js
  8. 0 {test → spec}/dummy/app/assets/stylesheets/application.css
  9. 0 {test → spec}/dummy/app/controllers/application_controller.rb
  10. 0 {test → spec}/dummy/app/helpers/application_helper.rb
  11. 0 {test → spec}/dummy/app/mailers/.gitkeep
  12. 0 {test → spec}/dummy/app/models/.gitkeep
  13. 0 {test → spec}/dummy/app/views/layouts/application.html.erb
  14. 0 {test → spec}/dummy/config.ru
  15. 0 {test → spec}/dummy/config/application.rb
  16. 0 {test → spec}/dummy/config/boot.rb
  17. 0 {test → spec}/dummy/config/database.yml
  18. 0 {test → spec}/dummy/config/environment.rb
  19. 0 {test → spec}/dummy/config/environments/development.rb
  20. 0 {test → spec}/dummy/config/environments/production.rb
  21. 0 {test → spec}/dummy/config/environments/test.rb
  22. 0 {test → spec}/dummy/config/initializers/backtrace_silencers.rb
  23. 0 {test → spec}/dummy/config/initializers/inflections.rb
  24. 0 {test → spec}/dummy/config/initializers/mime_types.rb
  25. 0 {test → spec}/dummy/config/initializers/secret_token.rb
  26. 0 {test → spec}/dummy/config/initializers/session_store.rb
  27. 0 {test → spec}/dummy/config/initializers/wrap_parameters.rb
  28. 0 {test → spec}/dummy/config/locales/en.yml
  29. 0 {test → spec}/dummy/config/routes.rb
  30. 0 {test → spec}/dummy/lib/assets/.gitkeep
  31. 0 {test → spec}/dummy/log/.gitkeep
  32. 0 {test → spec}/dummy/public/404.html
  33. 0 {test → spec}/dummy/public/422.html
  34. 0 {test → spec}/dummy/public/500.html
  35. 0 {test → spec}/dummy/public/favicon.ico
  36. 0 {test → spec}/dummy/script/rails
  37. +38 −0 spec/spec_helper.rb
  38. +1 −0 stat_board.gemspec
  39. +0 −9 test/functional/stat_board/stats_controller_test.rb
  40. +0 −10 test/integration/navigation_test.rb
  41. +0 −7 test/stat_board_test.rb
  42. +0 −15 test/test_helper.rb
View
@@ -1,7 +1,7 @@
.bundle/
log/*.log
pkg/
-test/dummy/db/*.sqlite3
-test/dummy/log/*.log
-test/dummy/tmp/
-test/dummy/.sass-cache
+spec/dummy/db/*.sqlite3
+spec/dummy/log/*.log
+spec/dummy/tmp/
+spec/dummy/.sass-cache
View
1 .rspec
@@ -0,0 +1 @@
+--color
View
@@ -36,6 +36,7 @@ GEM
multi_json (~> 1.0)
arel (3.0.2)
builder (3.0.4)
+ diff-lcs (1.1.3)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.1)
@@ -76,6 +77,17 @@ GEM
rake (10.0.2)
rdoc (3.12)
json (~> 1.4)
+ rspec-core (2.12.0)
+ rspec-expectations (2.12.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.12.0)
+ rspec-rails (2.12.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
sprockets (2.2.1)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -94,5 +106,6 @@ PLATFORMS
DEPENDENCIES
jquery-rails
+ rspec-rails
sqlite3
stat_board!
View
@@ -20,21 +20,13 @@ RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end
-APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
+APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
-
-
Bundler::GemHelper.install_tasks
-require 'rake/testtask'
-
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = false
-end
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
-task :default => :test
+task :default => :spec
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,38 @@
+ENV["RAILS_ENV"] ||= 'test'
+
+require File.expand_path("../../spec/dummy/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
+
+ # Run specs in random order to surface order dependencies. If you find an
+ # order dependency and want to debug it, you can fix the order by providing
+ # the seed, which is printed after each run.
+ # --seed 1234
+ config.order = "random"
+end
View
@@ -20,4 +20,5 @@ Gem::Specification.new do |s|
# s.add_dependency "jquery-rails"
s.add_development_dependency "sqlite3"
+ s.add_development_dependency "rspec-rails"
end
@@ -1,9 +0,0 @@
-require 'test_helper'
-
-module StatBoard
- class StatsControllerTest < ActionController::TestCase
- # test "the truth" do
- # assert true
- # end
- end
-end
@@ -1,10 +0,0 @@
-require 'test_helper'
-
-class NavigationTest < ActionDispatch::IntegrationTest
- fixtures :all
-
- # test "the truth" do
- # assert true
- # end
-end
-
View
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class StatBoardTest < ActiveSupport::TestCase
- test "truth" do
- assert_kind_of Module, StatBoard
- end
-end
View
@@ -1,15 +0,0 @@
-# Configure Rails Environment
-ENV["RAILS_ENV"] = "test"
-
-require File.expand_path("../dummy/config/environment.rb", __FILE__)
-require "rails/test_help"
-
-Rails.backtrace_cleaner.remove_silencers!
-
-# Load support files
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-
-# Load fixtures from the engine
-if ActiveSupport::TestCase.method_defined?(:fixture_path=)
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
-end

0 comments on commit b311b18

Please sign in to comment.