Permalink
Browse files

more work on specs

  • Loading branch information...
1 parent 800fdde commit 3ee1c969ea6d5ed7a81806f13b88abf295521da0 @NoamB committed Apr 21, 2011
Showing with 111 additions and 92 deletions.
  1. +2 −2 Gemfile
  2. +11 −11 Gemfile.lock
  3. +1 −1 spec/Gemfile
  4. +8 −8 spec/Gemfile.lock
  5. +1 −0 spec/Rakefile
  6. 0 spec/rails3/{app_root → }/.gitignore
  7. +1 −1 spec/rails3/.rspec
  8. +2 −2 spec/rails3/{app_root → }/Gemfile
  9. +12 −12 spec/rails3/{app_root → }/Gemfile.lock
  10. 0 spec/rails3/{app_root → }/README
  11. +1 −0 spec/rails3/{app_root → }/Rakefile
  12. 0 spec/rails3/{app_root → }/Rakefile.unused
  13. 0 spec/rails3/{app_root → }/app/controllers/application_controller.rb
  14. 0 spec/rails3/{app_root → }/app/helpers/application_helper.rb
  15. 0 spec/rails3/{app_root → }/app/mailers/sorcery_mailer.rb
  16. 0 spec/rails3/{app_root → }/app/models/authentication.rb
  17. 0 spec/rails3/{app_root → }/app/models/user.rb
  18. 0 spec/rails3/{app_root → }/app/views/layouts/application.html.erb
  19. 0 spec/rails3/{app_root → }/app/views/sorcery_mailer/activation_email.html.erb
  20. 0 spec/rails3/{app_root → }/app/views/sorcery_mailer/activation_email.text.erb
  21. 0 spec/rails3/{app_root → }/app/views/sorcery_mailer/activation_success_email.html.erb
  22. 0 spec/rails3/{app_root → }/app/views/sorcery_mailer/activation_success_email.text.erb
  23. 0 spec/rails3/{app_root → }/app/views/sorcery_mailer/reset_password_email.html.erb
  24. 0 spec/rails3/{app_root → }/app/views/sorcery_mailer/reset_password_email.text.erb
  25. +0 −1 spec/rails3/app_root/.rspec
  26. +0 −27 spec/rails3/app_root/config/database.yml
  27. +0 −2 spec/rails3/app_root/spec/spec.opts
  28. 0 spec/rails3/{app_root → }/config.ru
  29. 0 spec/rails3/{app_root → }/config/application.rb
  30. 0 spec/rails3/{app_root → }/config/boot.rb
  31. +27 −0 spec/rails3/config/database.yml
  32. 0 spec/rails3/{app_root → }/config/environment.rb
  33. 0 spec/rails3/{app_root → }/config/environments/development.rb
  34. 0 spec/rails3/{app_root → }/config/environments/in_memory.rb
  35. 0 spec/rails3/{app_root → }/config/environments/production.rb
  36. 0 spec/rails3/{app_root → }/config/environments/test.rb
  37. 0 spec/rails3/{app_root → }/config/initializers/backtrace_silencers.rb
  38. 0 spec/rails3/{app_root → }/config/initializers/inflections.rb
  39. 0 spec/rails3/{app_root → }/config/initializers/mime_types.rb
  40. 0 spec/rails3/{app_root → }/config/initializers/secret_token.rb
  41. 0 spec/rails3/{app_root → }/config/initializers/session_store.rb
  42. 0 spec/rails3/{app_root → }/config/locales/en.yml
  43. 0 spec/rails3/{app_root → }/config/routes.rb
  44. 0 spec/rails3/{app_root → }/db/migrate/activation/20101224223622_add_activation_to_users.rb
  45. 0 .../rails3/{app_root → }/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
  46. 0 ..._root → }/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb
  47. 0 spec/rails3/{app_root → }/db/migrate/core/20101224223620_create_users.rb
  48. 0 spec/rails3/{app_root → }/db/migrate/external/20101224223628_create_authentications.rb
  49. 0 spec/rails3/{app_root → }/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb
  50. 0 spec/rails3/{app_root → }/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb
  51. 0 spec/rails3/{app_root → }/db/schema.rb
  52. 0 spec/rails3/{app_root → }/db/seeds.rb
  53. 0 spec/rails3/{app_root/vendor/plugins → lib/tasks}/.gitkeep
  54. 0 spec/rails3/{app_root → }/public/404.html
  55. 0 spec/rails3/{app_root → }/public/422.html
  56. 0 spec/rails3/{app_root → }/public/500.html
  57. 0 spec/rails3/{app_root → }/public/favicon.ico
  58. BIN spec/rails3/{app_root → }/public/images/rails.png
  59. 0 spec/rails3/{app_root → }/public/index.html
  60. 0 spec/rails3/{app_root → }/public/javascripts/application.js
  61. 0 spec/rails3/{app_root → }/public/javascripts/controls.js
  62. 0 spec/rails3/{app_root → }/public/javascripts/dragdrop.js
  63. 0 spec/rails3/{app_root → }/public/javascripts/effects.js
  64. 0 spec/rails3/{app_root → }/public/javascripts/prototype.js
  65. 0 spec/rails3/{app_root → }/public/javascripts/rails.js
  66. 0 spec/rails3/{app_root → }/public/robots.txt
  67. 0 spec/rails3/{app_root → }/public/stylesheets/.gitkeep
  68. 0 spec/rails3/{app_root → }/script/rails
  69. 0 spec/rails3/{app_root → }/spec/controller_activity_logging_spec.rb
  70. 0 spec/rails3/{app_root → }/spec/controller_brute_force_protection_spec.rb
  71. 0 spec/rails3/{app_root → }/spec/controller_http_basic_auth_spec.rb
  72. 0 spec/rails3/{app_root → }/spec/controller_oauth2_spec.rb
  73. 0 spec/rails3/{app_root → }/spec/controller_oauth_spec.rb
  74. 0 spec/rails3/{app_root → }/spec/controller_remember_me_spec.rb
  75. 0 spec/rails3/{app_root → }/spec/controller_session_timeout_spec.rb
  76. 0 spec/rails3/{app_root → }/spec/controller_spec.rb
  77. +2 −0 spec/rails3/spec/spec.opts
  78. 0 spec/rails3/{app_root → }/spec/spec_helper.orig.rb
  79. +28 −11 spec/rails3/{app_root → }/spec/spec_helper.rb
  80. 0 spec/rails3/{app_root → }/spec/user_activation_spec.rb
  81. 0 spec/rails3/{app_root → }/spec/user_activity_logging_spec.rb
  82. 0 spec/rails3/{app_root → }/spec/user_brute_force_protection_spec.rb
  83. 0 spec/rails3/{app_root → }/spec/user_oauth_spec.rb
  84. 0 spec/rails3/{app_root → }/spec/user_remember_me_spec.rb
  85. 0 spec/rails3/{app_root → }/spec/user_reset_password_spec.rb
  86. 0 spec/rails3/{app_root → }/spec/user_spec.rb
  87. 0 spec/rails3/{app_root/lib/tasks → vendor/plugins}/.gitkeep
  88. +1 −1 spec/sinatra/Gemfile
  89. +9 −9 spec/sinatra/Gemfile.lock
  90. +1 −0 spec/sinatra/Rakefile
  91. +2 −2 spec/sinatra/spec/spec.opts
  92. +2 −2 spec/spec.opts
View
@@ -9,8 +9,8 @@ gem 'oauth2', ">= 0.1.1"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
- gem "rspec", "~> 2.3.0"
- gem 'rspec-rails'
+ gem "rspec", "~> 2.5.0"
+ gem 'rspec-rails', "~> 2.5.0"
gem 'ruby-debug19'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem "yard", "~> 0.6.0"
View
@@ -81,19 +81,19 @@ GEM
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
- rspec (2.3.0)
- rspec-core (~> 2.3.0)
- rspec-expectations (~> 2.3.0)
- rspec-mocks (~> 2.3.0)
- rspec-core (2.3.1)
- rspec-expectations (2.3.0)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.3.0)
- rspec-rails (2.3.1)
+ rspec-mocks (2.5.0)
+ rspec-rails (2.5.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
- rspec (~> 2.3.0)
+ rspec (~> 2.5.0)
ruby-debug-base19 (0.11.24)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
@@ -124,8 +124,8 @@ DEPENDENCIES
oauth (>= 0.4.4)
oauth2 (>= 0.1.1)
rails (>= 3.0.0)
- rspec (~> 2.3.0)
- rspec-rails
+ rspec (~> 2.5.0)
+ rspec-rails (~> 2.5.0)
ruby-debug19
simplecov (>= 0.3.8)
sqlite3-ruby
View
@@ -6,7 +6,7 @@ gem "sorcery", '0.3.1', :path => '../../../'
gem 'oauth', ">= 0.4.4"
gem 'oauth2', ">= 0.1.1"
group :development do
- gem 'rspec'
+ gem "rspec", "~> 2.5.0"
gem 'ruby-debug19'
gem 'simplecov', '>= 0.3.8', :require => false # Will install simplecov-html as a dependency
end
View
@@ -81,14 +81,14 @@ GEM
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
- rspec (2.3.0)
- rspec-core (~> 2.3.0)
- rspec-expectations (~> 2.3.0)
- rspec-mocks (~> 2.3.0)
- rspec-core (2.3.1)
- rspec-expectations (2.3.0)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.3.0)
+ rspec-mocks (2.5.0)
ruby-debug-base19 (0.11.24)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
@@ -115,7 +115,7 @@ DEPENDENCIES
oauth (>= 0.4.4)
oauth2 (>= 0.1.1)
rails (= 3.0.3)
- rspec
+ rspec (~> 2.5.0)
ruby-debug19
simplecov (>= 0.3.8)
sorcery (= 0.3.1)!
View
@@ -8,4 +8,5 @@ task :default => :spec
desc "Run all specs for a specific rails version"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = '*_spec.rb'
+ t.rspec_opts = ["--options #{File.dirname(__FILE__)}/spec.opts"]
end
File renamed without changes.
View
@@ -1 +1 @@
---color
+--colour
@@ -5,8 +5,8 @@ gem 'sqlite3-ruby', :require => 'sqlite3'
gem "sorcery", '0.3.1', :path => '../../../'
group :development, :test do
- gem 'rspec'
- gem 'rspec-rails'
+ gem "rspec", "~> 2.5.0"
+ gem 'rspec-rails', "~> 2.5.0"
gem 'ruby-debug19'
gem 'simplecov', '>= 0.3.8', :require => false # Will install simplecov-html as a dependency
gem 'timecop'
@@ -1,6 +1,7 @@
PATH
remote: ../../../
specs:
+ oauth (0.4.4)
sorcery (0.3.1)
bcrypt-ruby (~> 2.1.4)
json (>= 1.5.1)
@@ -65,7 +66,6 @@ GEM
mime-types (1.16)
multi_json (0.0.5)
multipart-post (1.1.0)
- oauth (0.4.4)
oauth2 (0.4.0)
faraday (~> 0.6.0)
multi_json (~> 0.0.4)
@@ -89,19 +89,19 @@ GEM
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
- rspec (2.3.0)
- rspec-core (~> 2.3.0)
- rspec-expectations (~> 2.3.0)
- rspec-mocks (~> 2.3.0)
- rspec-core (2.3.1)
- rspec-expectations (2.3.0)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.3.0)
- rspec-rails (2.3.1)
+ rspec-mocks (2.5.0)
+ rspec-rails (2.5.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
- rspec (~> 2.3.0)
+ rspec (~> 2.5.0)
ruby-debug-base19 (0.11.24)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
@@ -127,8 +127,8 @@ PLATFORMS
DEPENDENCIES
rails (= 3.0.3)
- rspec
- rspec-rails
+ rspec (~> 2.5.0)
+ rspec-rails (~> 2.5.0)
ruby-debug19
simplecov (>= 0.3.8)
sorcery (= 0.3.1)!
File renamed without changes.
@@ -7,4 +7,5 @@ task :default => :spec
desc "Run all specs for a specific rails version"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = '**/*_spec.rb'
+ t.rspec_opts = ["--options #{File.dirname(__FILE__)}/spec/spec.opts"]
end
@@ -1 +0,0 @@
---colour
@@ -1,27 +0,0 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- pool: 5
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- pool: 5
- timeout: 5000
-
-in_memory:
- adapter: sqlite3
- database: ":memory:"
- verbosity: quiet
@@ -1,2 +0,0 @@
---colour
---format progress
File renamed without changes.
@@ -0,0 +1,27 @@
+# SQLite version 3.x
+# gem install sqlite3-ruby (not necessary on OS X Leopard)
+# development:
+# adapter: sqlite3
+# database: db/development.sqlite3
+# pool: 5
+# timeout: 5000
+#
+# # Warning: The database defined as "test" will be erased and
+# # re-generated from your development database when you run "rake".
+# # Do not set this db to the same as development or production.
+# test:
+# adapter: sqlite3
+# database: db/test.sqlite3
+# pool: 5
+# timeout: 5000
+#
+# production:
+# adapter: sqlite3
+# database: db/production.sqlite3
+# pool: 5
+# timeout: 5000
+
+in_memory:
+ adapter: sqlite3
+ database: ":memory:"
+ verbosity: quiet
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,2 @@
+--color
+--format documentation
@@ -1,7 +1,12 @@
$: << File.join(File.dirname(__FILE__), '..', '..', 'lib' )
-
+# This file is copied to spec/ when you run 'rails generate rspec:install'
+# Set the default environment to sqlite3's in_memory database
+ENV['RAILS_ENV'] ||= 'in_memory'
+require File.expand_path("../../config/environment", __FILE__)
+require 'rspec/rails'
+require 'timecop'
# require 'simplecov'
-# SimpleCov.root File.join(File.dirname(__FILE__), "..", "..", "app_root" )
+# SimpleCov.root File.join(File.dirname(__FILE__), "..", "..", "rails3" )
# SimpleCov.start do
# add_filter "/config/"
#
@@ -13,20 +18,31 @@
# add_group 'Migrations', 'db/migrate'
# end
-require 'timecop'
-# Set the default environment to sqlite3's in_memory database
-ENV['RAILS_ENV'] ||= 'in_memory'
-ENV['RAILS_ROOT'] = 'app_root'
+# 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}
+
-# Load the Rails environment and testing framework
-require "#{File.dirname(__FILE__)}/../config/environment"
-require 'rspec/rails'
RSpec.configure do |config|
- config.use_transactional_fixtures = true
- config.use_instantiated_fixtures = false
config.include RSpec::Rails::ControllerExampleGroup, :example_group => { :file_path => /controller(.)*_spec.rb$/ }
+ # == 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
+ # 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
+
config.before(:suite) do
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/core")
end
@@ -51,3 +67,4 @@ class TestMailer < ActionMailer::Base
include ::Sorcery::TestHelpers
include ::Sorcery::TestHelpers::Rails
+
@@ -5,7 +5,7 @@ gem 'sqlite3-ruby', :require => 'sqlite3'
gem "sorcery", '0.3.1', :path => '../../'
group :development, :test do
- gem 'rspec'
+ gem "rspec", "~> 2.5.0"
gem 'ruby-debug19'
gem 'simplecov', '>= 0.3.8', :require => false # Will install simplecov-html as a dependency
gem 'timecop'
@@ -71,7 +71,7 @@ GEM
multi_json (~> 0.0.4)
polyglot (0.3.1)
rack (1.2.1)
- rack-mount (0.6.13)
+ rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
@@ -89,14 +89,14 @@ GEM
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
- rspec (2.4.0)
- rspec-core (~> 2.4.0)
- rspec-expectations (~> 2.4.0)
- rspec-mocks (~> 2.4.0)
- rspec-core (2.4.0)
- rspec-expectations (2.4.0)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.4.0)
+ rspec-mocks (2.5.0)
ruby-debug-base19 (0.11.24)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
@@ -125,7 +125,7 @@ PLATFORMS
ruby
DEPENDENCIES
- rspec
+ rspec (~> 2.5.0)
ruby-debug19
simplecov (>= 0.3.8)
sinatra (>= 1.2.0)
@@ -7,4 +7,5 @@ task :default => :spec
desc "Run all specs"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = '**/*_spec.rb'
+ t.rspec_opts = ["--options #{File.dirname(__FILE__)}/spec/spec.opts"]
end
@@ -1,2 +1,2 @@
---colour
---format progress
+--color
+--format documentation
View
@@ -1,2 +1,2 @@
---colour
---format progress
+--color
+--format documentation

0 comments on commit 3ee1c96

Please sign in to comment.