Re: [rspec-users] it blocks not executing
Did this help at all? On Jun 7, 2012, at 9:51 AM, Robbie Leib wrote: * * Rakefile * * require(File.join(File.dirname(__FILE__), 'config', 'boot')) require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'tasks/rails' # Load the resque gem rake tasks into our namespace # http://stackoverflow.com/questions/1878640/including-rake-tasks-in-gems Dir[#{Gem.searcher.find('resque').full_gem_path}/lib/tasks/*.rake].each { |ext| load ext } * * rspec.rake * * gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f = 1.9 rspec_gem_dir = nil Dir[#{RAILS_ROOT}/vendor/gems/*].each do |subdir| rspec_gem_dir = subdir if subdir.gsub(#{RAILS_ROOT}/vendor/gems/,) =~ /^(\w+-)?rspec-(\d+)/ File.exist?(#{subdir}/lib/spec/rake/spectask.rb) end rspec_plugin_dir = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec') if rspec_gem_dir (test ?d, rspec_plugin_dir) raise \n#{'*'*50}\nYou have rspec installed in both vendor/gems and vendor/plugins\nPlease pick one and dispose of the other.\n#{'*'*50}\n\n end if rspec_gem_dir $LOAD_PATH.unshift(#{rspec_gem_dir}/lib) elsif File.exist?(rspec_plugin_dir) $LOAD_PATH.unshift(#{rspec_plugin_dir}/lib) end # Don't load rspec if running rake gems:* unless ARGV.any? {|a| a =~ /^gems/} begin require 'spec/rake/spectask' rescue MissingSourceFile module Spec module Rake class SpecTask include ::Rake::DSL if defined?(::Rake::DSL) def initialize(name) task name do # if rspec-rails is a configured gem, this will output helpful material and exit ... require File.expand_path(File.join(File.dirname(__FILE__),..,..,config,environment)) # ... otherwise, do this: raise -MSG #{* * 80} * You are trying to run an rspec rake task defined in * #{__FILE__}, * but rspec can not be found in vendor/gems, vendor/plugins or system gems. #{* * 80} MSG end end end end end end Rake.application.instance_variable_get('@tasks').delete('default') spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? db:test:prepare : :noop task :noop do end task :default = :spec task :stats = spec:statsetup desc Run all specs in spec directory (excluding plugin specs) Spec::Rake::SpecTask.new(:spec = spec_prereq) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['spec/**/*_spec.rb'] end namespace :spec do desc Run all specs in spec directory with RCov (excluding plugin specs) Spec::Rake::SpecTask.new(:rcov) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['spec/**/*_spec.rb'] t.rcov = true t.rcov_opts = lambda do IO.readlines(#{RAILS_ROOT}/spec/rcov.opts).map {|l| l.chomp.split }.flatten end end desc Print Specdoc for all specs (excluding plugin specs) Spec::Rake::SpecTask.new(:doc) do |t| t.spec_opts = [--format, specdoc, --dry-run] t.spec_files = FileList['spec/**/*_spec.rb'] end desc Print Specdoc for all plugin examples Spec::Rake::SpecTask.new(:plugin_doc) do |t| t.spec_opts = [--format, specdoc, --dry-run] t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*') end [:models, :controllers, :views, :helpers, :lib, :integration].each do |sub| desc Run the code examples in spec/#{sub} Spec::Rake::SpecTask.new(sub = spec_prereq) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList[spec/#{sub}/**/*_spec.rb] end end desc Run the code examples in vendor/plugins (except RSpec's own) Spec::Rake::SpecTask.new(:plugins = spec_prereq) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude(vendor/plugins/rspec-rails/*) end namespace :plugins do desc Runs the examples for rspec_on_rails Spec::Rake::SpecTask.new(:rspec_on_rails) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb'] end end # Setup specs for stats task :statsetup do require 'code_statistics' ::STATS_DIRECTORIES %w(Model\ specs spec/models) if File.exist?('spec/models') ::STATS_DIRECTORIES %w(View\ specs spec/views) if File.exist?('spec/views') ::STATS_DIRECTORIES %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers') ::STATS_DIRECTORIES %w(Helper\ specs spec/helpers)
Re: [rspec-users] it blocks not executing
ruby -v: ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [i686-darwin11.4.0], MBARI 0x6770, Ruby Enterprise Edition 2012.02 bundle list: * Ascii85 (1.0.1) * POpen4 (0.1.4) * Platform (0.4.0) * RedCloth (4.1.9) * RubyInline (3.11.2) * SystemTimer (1.2.3) * ZenTest (4.8.1) * actionmailer (2.3.14) * actionpack (2.3.14) * activerecord (2.3.14) * activeresource (2.3.14) * activesupport (2.3.14) * addressable (2.2.8) * after_commit (1.0.8) * airbrake (3.1.0) * amazon-ecs (0.5.7) * ancestry (1.3.0) * annotate (2.4.0) * archive-tar-minitar (0.5.2) * barby (0.3.2) * bitly (0.6.1) * builder (3.0.0) * bundler (1.1.4) * capistrano (2.12.0) * capybara (1.1.1) * cgi_multipart_eof_fix (2.5.0) * childprocess (0.3.2) * chronic (0.3.0) * color (1.4.0) * columnize (0.3.6) * crack (0.1.6) * cucumber (1.1.0) * cucumber-rails (0.3.2) * daemons (1.0.10) * dalli (1.0.5) * database_cleaner (0.8.0) * date-performance (0.4.8) * diff-lcs (1.1.3) * domain_name (0.5.3) * excon (0.6.6) * factory_girl (2.6.4) * faraday (0.7.6) * fastercsv (1.5.3) * fastthread (1.0.7) * ffi (1.0.11) * fog (0.10.0) * foreman (0.46.0) * forgery (0.3.0) * formatador (0.2.3) * gem_plugin (0.2.3) * geokit (1.6.5 98b758b) * gherkin (2.5.4) * git_remote_branch (0.3.3) * google4r-checkout (1.0.6 c6f7c0a) * grit (2.5.0) * growl (1.0.3) * guard (1.1.1) * guard-cucumber (0.7.5) * guard-rspec (1.0.0) * guard-test (0.5.0) * hashie (0.2.2) * heroku (2.25.0) * highline (1.6.12) * hiredis (0.4.5) * hoe (2.8.0) * hpricot (0.8.6) * httparty (0.5.2) * httpauth (0.1) * icalendar (1.0.2) * image_science (1.1.3) * jammit (0.6.5) * json (1.4.6) * json_pure (1.7.3) * kgio (2.7.4) * koala (1.3.0) * launchy (2.1.0) * libwebsocket (0.1.3) * libxml-ruby (1.1.3) * linecache (0.46) * listen (0.4.2) * mail (2.2.5) * mechanize (2.1.1) * metaclass (0.0.1) * mime-types (1.16) * mocha (0.11.4) * money (3.0.5) * mongrel (1.1.5) * multi_json (1.0.4) * multipart-post (1.1.5) * mysql2 (0.2.18) * net-http-digest_auth (1.2.1) * net-http-persistent (2.6) * net-scp (1.0.4) * net-sftp (2.0.5) * net-ssh (2.1.4) * net-ssh-gateway (1.1.0) * netrc (0.7.4) * newrelic_rpm (3.3.5) * nokogiri (1.5.3) * ntlm-http (0.1.1) * oauth (0.4.1) * oauth2 (0.6.0) * open4 (1.3.0) * pdf-reader (1.1.1) * png (1.2.0) * polyglot (0.3.1) * posix-spawn (0.3.6) * prawn (0.12.0) * rabl (0.3.0) * rack (1.1.3) * rack-test (0.6.1) * rails (2.3.14) * rainbow (1.1.4) * rake (0.9.2.2) * rb-fchange (0.0.5) * rb-fsevent (0.9.1) * rb-inotify (0.8.8) * rbx-require-relative (0.0.9) * rcov (1.0.0) * redis (2.2.2) * redis-namespace (1.0.3) * resque (1.19.0 361879d) * resque-retry (0.1.0 d3fe417) * resque-scheduler (1.9.9 f57e393) * rest-client (1.6.1) * right_aws (3.0.4) * right_http_connection (1.3.0) * rmagick (2.5.2) * rpm_contrib (2.1.11) * rspec (1.3.2) * rspec-rails (1.3.4 dcabc8b) * ruby-debug (0.10.4) * ruby-debug-base (0.10.4) * ruby-hmac (0.3.2) * ruby-rc4 (0.1.5) * rubyzip (0.9.4) * rufus-scheduler (2.0.7) * rvideo (0.9.3) * sanitize (2.0.3) * sanitize_email (0.3.7) * sass (3.1.19) * selenium-webdriver (2.22.2) * shoulda (3.0.1) * shoulda-context (1.0.0) * shoulda-matchers (1.0.0) * showoff-io (0.3.1) * simple-navigation (3.7.0) * sinatra (1.1.0) * spork (0.8.5) * spork-testunit (0.0.8) * subcontractor (0.3.2) * term-ansicolor (1.0.7) * termios (0.9.4) * test-unit (2.2.0) * thor (0.15.2) * tilt (1.1) * timecop (0.3.5) * transaction-simple (1.4.0) * treetop (1.4.10) * ttfunk (1.0.3) * twitter (0.9.8) * typhoeus (0.2.4) * tzinfo (0.3.33) * unf (0.0.5) * unf_ext (0.0.5) * vegas (0.1.11) * webrobots (0.0.13) * wice_grid (0.6.0 fdcff0e) * will_paginate (2.3.16) * xpath (0.1.4) * yajl-ruby (0.7.5) * yui-compressor (0.9.6) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] it blocks not executing
On Thu, Jun 7, 2012 at 11:51 AM, Robbie Leib rob...@onthecity.org wrote: * * rspec.rake * * gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f = 1.9 This might be the problem right here. Are you running in Ruby 1.9 and do you have test-unit-1.2.3 installed? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
Re: [rspec-users] it blocks not executing
* * Rakefile * * require(File.join(File.dirname(__FILE__), 'config', 'boot')) require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'tasks/rails' # Load the resque gem rake tasks into our namespace # http://stackoverflow.com/questions/1878640/including-rake-tasks-in-gems Dir[#{Gem.searcher.find('resque').full_gem_path}/lib/tasks/*.rake].each { |ext| load ext } * * rspec.rake * * gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f = 1.9 rspec_gem_dir = nil Dir[#{RAILS_ROOT}/vendor/gems/*].each do |subdir| rspec_gem_dir = subdir if subdir.gsub(#{RAILS_ROOT}/vendor/gems/,) =~ /^(\w+-)?rspec-(\d+)/ File.exist?(#{subdir}/lib/spec/rake/spectask.rb) end rspec_plugin_dir = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec') if rspec_gem_dir (test ?d, rspec_plugin_dir) raise \n#{'*'*50}\nYou have rspec installed in both vendor/gems and vendor/plugins\nPlease pick one and dispose of the other.\n#{'*'*50}\n\n end if rspec_gem_dir $LOAD_PATH.unshift(#{rspec_gem_dir}/lib) elsif File.exist?(rspec_plugin_dir) $LOAD_PATH.unshift(#{rspec_plugin_dir}/lib) end # Don't load rspec if running rake gems:* unless ARGV.any? {|a| a =~ /^gems/} begin require 'spec/rake/spectask' rescue MissingSourceFile module Spec module Rake class SpecTask include ::Rake::DSL if defined?(::Rake::DSL) def initialize(name) task name do # if rspec-rails is a configured gem, this will output helpful material and exit ... require File.expand_path(File.join(File.dirname(__FILE__),..,..,config,environment)) # ... otherwise, do this: raise -MSG #{* * 80} * You are trying to run an rspec rake task defined in * #{__FILE__}, * but rspec can not be found in vendor/gems, vendor/plugins or system gems. #{* * 80} MSG end end end end end end Rake.application.instance_variable_get('@tasks').delete('default') spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? db:test:prepare : :noop task :noop do end task :default = :spec task :stats = spec:statsetup desc Run all specs in spec directory (excluding plugin specs) Spec::Rake::SpecTask.new(:spec = spec_prereq) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['spec/**/*_spec.rb'] end namespace :spec do desc Run all specs in spec directory with RCov (excluding plugin specs) Spec::Rake::SpecTask.new(:rcov) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['spec/**/*_spec.rb'] t.rcov = true t.rcov_opts = lambda do IO.readlines(#{RAILS_ROOT}/spec/rcov.opts).map {|l| l.chomp.split }.flatten end end desc Print Specdoc for all specs (excluding plugin specs) Spec::Rake::SpecTask.new(:doc) do |t| t.spec_opts = [--format, specdoc, --dry-run] t.spec_files = FileList['spec/**/*_spec.rb'] end desc Print Specdoc for all plugin examples Spec::Rake::SpecTask.new(:plugin_doc) do |t| t.spec_opts = [--format, specdoc, --dry-run] t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*') end [:models, :controllers, :views, :helpers, :lib, :integration].each do |sub| desc Run the code examples in spec/#{sub} Spec::Rake::SpecTask.new(sub = spec_prereq) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList[spec/#{sub}/**/*_spec.rb] end end desc Run the code examples in vendor/plugins (except RSpec's own) Spec::Rake::SpecTask.new(:plugins = spec_prereq) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude(vendor/plugins/rspec-rails/*) end namespace :plugins do desc Runs the examples for rspec_on_rails Spec::Rake::SpecTask.new(:rspec_on_rails) do |t| t.spec_opts = ['--options', \#{RAILS_ROOT}/spec/spec.opts\] t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb'] end end # Setup specs for stats task :statsetup do require 'code_statistics' ::STATS_DIRECTORIES %w(Model\ specs spec/models) if File.exist?('spec/models') ::STATS_DIRECTORIES %w(View\ specs spec/views) if File.exist?('spec/views') ::STATS_DIRECTORIES %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers') ::STATS_DIRECTORIES %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers') ::STATS_DIRECTORIES %w(Library\ specs spec/lib) if File.exist?('spec/lib') ::STATS_DIRECTORIES %w(Routing\ specs
Re: [rspec-users] it blocks not executing
On Tue, Jun 5, 2012 at 3:47 PM, Robbie Leib rob...@onthecity.org wrote: Rails 2.3.14 app rspec (1.3.2) rspec-rails (1.3.4) When I run bundle exec rake spec, not matter what, I get: 0 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications This is not rspec's output, so something else is not configured correctly. Would you mind posting the Rakefile and spec/spec_helper.rb? 0% passed I have one spec file, and I hit the first debug statement, and not the 2nd: require 'spec_helper' describe Api::Admin::V1::UsersController do describe /api/admin/v1/users do describe GET index do debugger it should return first 20 users do debugger assert_equal false, true end it should return page 2 do end it should filter on last name do end end end end What could be causing this? Thanks, -- Robbie ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users