rspec-core 2.0.0.beta.22 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. data/.gitignore +1 -0
  2. data/.rspec +0 -1
  3. data/.travis.yml +7 -0
  4. data/Gemfile +46 -20
  5. data/Guardfile +5 -0
  6. data/License.txt +2 -1
  7. data/{README.markdown → README.md} +23 -5
  8. data/Rakefile +58 -31
  9. data/bin/autospec +13 -0
  10. data/bin/rspec +24 -2
  11. data/cucumber.yml +1 -1
  12. data/features/.nav +57 -0
  13. data/features/Autotest.md +38 -0
  14. data/features/Changelog.md +269 -0
  15. data/features/README.md +17 -0
  16. data/features/Upgrade.md +320 -0
  17. data/features/command_line/README.md +28 -0
  18. data/features/command_line/configure.feature +18 -15
  19. data/features/command_line/example_name_option.feature +37 -23
  20. data/features/command_line/exit_status.feature +16 -31
  21. data/features/command_line/format_option.feature +73 -0
  22. data/features/command_line/line_number_appended_to_path.feature +25 -27
  23. data/features/command_line/line_number_option.feature +11 -10
  24. data/features/command_line/rake_task.feature +68 -0
  25. data/features/command_line/tag.feature +90 -0
  26. data/features/configuration/alias_example_to.feature +48 -0
  27. data/features/configuration/custom_settings.feature +8 -10
  28. data/features/configuration/fail_fast.feature +77 -0
  29. data/features/configuration/read_options_from_file.feature +42 -26
  30. data/features/example_groups/basic_structure.feature +55 -0
  31. data/features/example_groups/shared_context.feature +74 -0
  32. data/features/example_groups/shared_example_group.feature +56 -41
  33. data/features/expectation_framework_integration/configure_expectation_framework.feature +73 -0
  34. data/features/filtering/exclusion_filters.feature +69 -9
  35. data/features/filtering/if_and_unless.feature +168 -0
  36. data/features/filtering/inclusion_filters.feature +58 -26
  37. data/features/filtering/run_all_when_everything_filtered.feature +46 -0
  38. data/features/formatters/custom_formatter.feature +17 -13
  39. data/features/formatters/text_formatter.feature +43 -0
  40. data/features/helper_methods/arbitrary_methods.feature +40 -0
  41. data/features/helper_methods/let.feature +50 -0
  42. data/features/helper_methods/modules.feature +149 -0
  43. data/features/hooks/around_hooks.feature +99 -69
  44. data/features/hooks/before_and_after_hooks.feature +74 -40
  45. data/features/hooks/filtering.feature +227 -0
  46. data/features/metadata/current_example.feature +17 -0
  47. data/features/metadata/described_class.feature +17 -0
  48. data/features/metadata/user_defined.feature +111 -0
  49. data/features/mock_framework_integration/use_any_framework.feature +106 -0
  50. data/features/mock_framework_integration/use_flexmock.feature +84 -11
  51. data/features/mock_framework_integration/use_mocha.feature +85 -11
  52. data/features/mock_framework_integration/use_rr.feature +86 -11
  53. data/features/mock_framework_integration/use_rspec.feature +85 -11
  54. data/features/pending/pending_examples.feature +143 -5
  55. data/features/spec_files/arbitrary_file_suffix.feature +2 -2
  56. data/features/step_definitions/additional_cli_steps.rb +30 -0
  57. data/features/subject/attribute_of_subject.feature +93 -15
  58. data/features/subject/explicit_subject.feature +28 -17
  59. data/features/subject/implicit_receiver.feature +29 -0
  60. data/features/subject/implicit_subject.feature +9 -10
  61. data/features/support/env.rb +6 -1
  62. data/lib/autotest/discover.rb +1 -0
  63. data/lib/autotest/rspec2.rb +15 -11
  64. data/lib/rspec/autorun.rb +2 -0
  65. data/lib/rspec/core/backward_compatibility.rb +33 -4
  66. data/lib/rspec/core/command_line.rb +4 -28
  67. data/lib/rspec/core/command_line_configuration.rb +16 -16
  68. data/lib/rspec/core/configuration.rb +279 -89
  69. data/lib/rspec/core/configuration_options.rb +46 -35
  70. data/lib/rspec/core/deprecation.rb +1 -1
  71. data/lib/rspec/core/drb_command_line.rb +5 -11
  72. data/lib/rspec/core/example.rb +63 -39
  73. data/lib/rspec/core/example_group.rb +109 -59
  74. data/lib/rspec/core/expecting/with_rspec.rb +11 -0
  75. data/lib/rspec/core/expecting/with_stdlib.rb +9 -0
  76. data/lib/rspec/core/extensions/kernel.rb +1 -1
  77. data/lib/rspec/core/extensions/object.rb +1 -3
  78. data/lib/rspec/core/formatters/base_formatter.rb +22 -11
  79. data/lib/rspec/core/formatters/base_text_formatter.rb +46 -30
  80. data/lib/rspec/core/formatters/documentation_formatter.rb +4 -2
  81. data/lib/rspec/core/formatters/helpers.rb +0 -4
  82. data/lib/rspec/core/formatters/html_formatter.rb +146 -41
  83. data/lib/rspec/core/formatters/progress_formatter.rb +1 -0
  84. data/lib/rspec/core/formatters/snippet_extractor.rb +1 -1
  85. data/lib/rspec/core/formatters/text_mate_formatter.rb +3 -1
  86. data/lib/rspec/core/hooks.rb +55 -17
  87. data/lib/rspec/core/metadata.rb +75 -64
  88. data/lib/rspec/core/metadata_hash_builder.rb +93 -0
  89. data/lib/rspec/core/mocking/with_flexmock.rb +2 -0
  90. data/lib/rspec/core/mocking/with_mocha.rb +2 -0
  91. data/lib/rspec/core/mocking/with_rr.rb +2 -0
  92. data/lib/rspec/core/mocking/with_rspec.rb +3 -1
  93. data/lib/rspec/core/option_parser.rb +48 -5
  94. data/lib/rspec/core/pending.rb +22 -4
  95. data/lib/rspec/core/rake_task.rb +64 -28
  96. data/lib/rspec/core/reporter.rb +3 -2
  97. data/lib/rspec/core/ruby_project.rb +2 -2
  98. data/lib/rspec/core/runner.rb +50 -6
  99. data/lib/rspec/core/shared_context.rb +16 -0
  100. data/lib/rspec/core/shared_example_group.rb +19 -4
  101. data/lib/rspec/core/subject.rb +92 -65
  102. data/lib/rspec/core/version.rb +1 -1
  103. data/lib/rspec/core/world.rb +83 -25
  104. data/lib/rspec/core.rb +40 -24
  105. data/lib/rspec/monkey/spork/test_framework/rspec.rb +1 -0
  106. data/rspec-core.gemspec +4 -25
  107. data/script/FullBuildRakeFile +63 -0
  108. data/script/cucumber +1 -0
  109. data/script/full_build +1 -0
  110. data/script/spec +1 -0
  111. data/spec/autotest/discover_spec.rb +19 -0
  112. data/spec/autotest/failed_results_re_spec.rb +25 -9
  113. data/spec/autotest/rspec_spec.rb +32 -41
  114. data/spec/rspec/core/command_line_spec.rb +62 -7
  115. data/spec/rspec/core/configuration_options_spec.rb +184 -148
  116. data/spec/rspec/core/configuration_spec.rb +406 -108
  117. data/spec/rspec/core/deprecations_spec.rb +38 -1
  118. data/spec/rspec/core/drb_command_line_spec.rb +21 -56
  119. data/spec/rspec/core/example_group_spec.rb +366 -127
  120. data/spec/rspec/core/example_spec.rb +125 -45
  121. data/spec/rspec/core/formatters/base_formatter_spec.rb +61 -1
  122. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +39 -5
  123. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +7 -6
  124. data/spec/rspec/core/formatters/helpers_spec.rb +1 -1
  125. data/spec/rspec/core/formatters/html_formatted-1.8.6.html +199 -81
  126. data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +199 -83
  127. data/spec/rspec/core/formatters/html_formatted-1.8.7.html +199 -81
  128. data/spec/rspec/core/formatters/html_formatted-1.9.1.html +206 -81
  129. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +206 -61
  130. data/spec/rspec/core/formatters/html_formatter_spec.rb +17 -9
  131. data/spec/rspec/core/formatters/progress_formatter_spec.rb +1 -1
  132. data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +199 -81
  133. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +199 -81
  134. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +199 -81
  135. data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +206 -81
  136. data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +206 -81
  137. data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +22 -7
  138. data/spec/rspec/core/hooks_filtering_spec.rb +128 -5
  139. data/spec/rspec/core/hooks_spec.rb +90 -4
  140. data/spec/rspec/core/metadata_spec.rb +176 -163
  141. data/spec/rspec/core/option_parser_spec.rb +73 -6
  142. data/spec/rspec/core/pending_example_spec.rb +137 -35
  143. data/spec/rspec/core/rake_task_spec.rb +62 -29
  144. data/spec/rspec/core/reporter_spec.rb +20 -4
  145. data/spec/rspec/core/resources/formatter_specs.rb +25 -1
  146. data/spec/rspec/core/rspec_matchers_spec.rb +45 -0
  147. data/spec/rspec/core/runner_spec.rb +60 -10
  148. data/spec/rspec/core/shared_context_spec.rb +30 -0
  149. data/spec/rspec/core/shared_example_group_spec.rb +59 -23
  150. data/spec/rspec/core/subject_spec.rb +136 -0
  151. data/spec/rspec/core/world_spec.rb +211 -68
  152. data/spec/rspec/core_spec.rb +28 -0
  153. data/spec/spec_helper.rb +41 -23
  154. data/spec/support/matchers.rb +44 -13
  155. data/spec/support/shared_example_groups.rb +41 -0
  156. data/spec/support/spec_files.rb +44 -0
  157. data/spec.txt +1126 -0
  158. metadata +99 -168
  159. data/.treasure_map.rb +0 -23
  160. data/History.md +0 -30
  161. data/Upgrade.markdown +0 -150
  162. data/autotest/discover.rb +0 -2
  163. data/features/README.markdown +0 -12
  164. data/features/example_groups/describe_aliases.feature +0 -25
  165. data/features/example_groups/nested_groups.feature +0 -44
  166. data/features/hooks/described_class.feature +0 -14
  167. data/features/hooks/halt.feature +0 -26
  168. data/lib/rspec/core/around_proxy.rb +0 -14
  169. data/lib/rspec/core/formatters.rb +0 -8
  170. data/spec/ruby_forker.rb +0 -13
  171. data/specs.watchr +0 -59
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .rvmrc
1
2
  *.sw?
2
3
  .DS_Store
3
4
  coverage*
data/.rspec CHANGED
@@ -1 +0,0 @@
1
- --color
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ script: "rake"
2
+ rvm:
3
+ - 1.8.6
4
+ - 1.8.7
5
+ - 1.9.1
6
+ - 1.9.2
7
+ - ree
data/Gemfile CHANGED
@@ -1,24 +1,50 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rake"
4
- gem "cucumber"
5
- gem "aruba", ">= 0.2.0"
6
- gem "autotest"
7
- gem "watchr"
8
- gem "rcov"
9
- gem "mocha"
10
- gem "rr"
11
- gem "flexmock"
12
- gem "nokogiri"
13
- gem "syntax"
14
- gem "rspec-core", :path => "."
15
- gem "rspec-expectations", :path => "../rspec-expectations"
16
- gem "rspec-mocks", :path => "../rspec-mocks"
17
- unless RUBY_PLATFORM == "java"
18
- case RUBY_VERSION
19
- when /^1.9.2/
20
- gem "ruby-debug19"
21
- when /^1.8/
22
- gem "ruby-debug"
3
+ ### rspec libs
4
+ %w[rspec rspec-core rspec-expectations rspec-mocks].each do |lib|
5
+ library_path = File.expand_path("../../#{lib}", __FILE__)
6
+ if File.exist?(library_path)
7
+ gem lib, :path => library_path
8
+ else
9
+ gem lib, :git => "git://github.com/rspec/#{lib}.git"
23
10
  end
24
11
  end
12
+
13
+
14
+ ### dev dependencies
15
+ gem "rake", "0.8.7"
16
+ gem "cucumber", "~> 0.10.2"
17
+ gem "aruba", "~> 0.3.6"
18
+ gem "rcov", "0.9.9", :platforms => :mri
19
+ gem "relish", "0.2.0"
20
+ gem "guard-rspec", "0.1.9"
21
+ gem "growl", "1.0.3"
22
+ gem "ZenTest", "~> 4.4.2"
23
+ gem "nokogiri", "1.4.4"
24
+
25
+ platforms :mri_18 do
26
+ gem 'ruby-debug'
27
+ end
28
+
29
+ platforms :mri_19 do
30
+ gem 'linecache19', '0.5.11' # 0.5.12 cannot install on 1.9.1, and 0.5.11 appears to work with both 1.9.1 & 1.9.2
31
+ gem 'ruby-debug19'
32
+ gem 'ruby-debug-base19', RUBY_VERSION == '1.9.1' ? '0.11.23' : '~> 0.11.24'
33
+ end
34
+
35
+ platforms :mri_18, :mri_19 do
36
+ gem "rb-fsevent", "~> 0.3.9"
37
+ gem "ruby-prof", "~> 0.9.2"
38
+ end
39
+
40
+ platforms :jruby do
41
+ gem "jruby-openssl"
42
+ end
43
+
44
+ ### rspec-core only
45
+ gem "mocha", "~> 0.9.10"
46
+ gem "rr", "~> 1.0.2"
47
+ gem "flexmock", "0.8.8"
48
+
49
+ ### optional runtime deps
50
+ gem "syntax", "1.0.0"
data/Guardfile ADDED
@@ -0,0 +1,5 @@
1
+ guard 'rspec', :version => 2 do
2
+ watch(/^spec\/(.*)_spec.rb/)
3
+ watch(/^lib\/(.*)\.rb/) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch(/^spec\/spec_helper.rb/) { "spec" }
5
+ end
data/License.txt CHANGED
@@ -1,6 +1,7 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2009 David Chelimsky, Chad Humphries
3
+ Copyright (c) 2009 Chad Humphries, David Chelimsky
4
+ Copyright (c) 2005 The RSpec Development Team
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining
6
7
  a copy of this software and associated documentation files (the
@@ -1,14 +1,32 @@
1
1
  # RSpec Core
2
2
 
3
- Behaviour Driven Development for Ruby
3
+ RSpec Core provides the structure for writing executable examples of how your
4
+ code should behave.
4
5
 
5
- ## Upgrading from rspec-1.x
6
+ [![build status](http://travis-ci.org/rspec/rspec-core.png)](http://travis-ci.org/rspec/rspec-core)
7
+
8
+ ## Documentation
9
+
10
+ The [Cucumber features](http://relishapp.com/rspec/rspec-core) are the
11
+ most comprehensive and up-to-date docs for end-users.
6
12
 
7
- See [Upgrade.markdown](http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown)
13
+ The [RDoc](http://rubydoc.info/gems/rspec-core/2.3.0/frames) provides
14
+ additional information for contributors and/or extenders.
15
+
16
+ All of the documentation is open source and a work in progress. If you find it
17
+ lacking or confusing, you can help improve it by submitting requests and
18
+ patches to the [rspec-core issue
19
+ tracker](https://github.com/rspec/rspec-core/issues).
8
20
 
9
21
  ## Install
10
22
 
11
- gem install rspec --prerelease
23
+ gem install rspec # for rspec-core, rspec-expectations, rspec-mocks
24
+ gem install rspec-core # for rspec-core only
25
+
26
+ ## Upgrading from rspec-1.x
27
+
28
+ See [features/Upgrade.md](http://github.com/rspec/rspec-core/blob/master/features/Upgrade.md)
29
+
12
30
 
13
31
  This will install the rspec, rspec-core, rspec-expectations and rspec-mocks
14
32
  gems.
@@ -47,7 +65,7 @@ Be sure to require the implementation file in the spec:
47
65
  require "calculator"
48
66
 
49
67
  Now run the spec again, and watch it pass:
50
-
68
+
51
69
  $ rspec spec/calculator_spec.rb
52
70
  .
53
71
 
data/Rakefile CHANGED
@@ -7,50 +7,77 @@ require "yaml"
7
7
 
8
8
  require "rake/rdoctask"
9
9
  require "rspec/core/rake_task"
10
- require "cucumber/rake/task"
10
+ require "rspec/core/version"
11
11
 
12
- RSpec::Core::RakeTask.new(:spec)
12
+ cucumber_loaded = false
13
+ begin
14
+ require "cucumber/rake/task"
13
15
 
14
- desc "Run all examples using rcov"
15
- RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
16
- t.rcov = true
17
- t.rcov_opts = %[-Ilib -Ispec --exclude "mocks,expectations,gems/*,spec/resources,spec/lib,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*"]
18
- t.rcov_opts << %[--no-html --aggregate coverage.data]
19
- end
16
+ Cucumber::Rake::Task.new(:cucumber)
20
17
 
21
- task :cleanup_rcov_files do
22
- rm_rf 'coverage.data'
18
+ class Cucumber::Rake::Task::ForkedCucumberRunner
19
+ # When cucumber shells out, we still need it to run in the context of our
20
+ # bundle.
21
+ def run
22
+ sh "bundle exec #{RUBY} " + args.join(" ")
23
+ end
24
+ end
25
+ cucumber_loaded = true
26
+ rescue LoadError => e
27
+ puts "unable to load cucumber, some tasks unavailable"
28
+ task :cucumber do
29
+ # no-op
30
+ end
23
31
  end
24
32
 
25
- task :clobber do
26
- rm_rf 'pkg'
27
- rm_rf 'tmp'
28
- rm_rf 'coverage'
33
+ desc "Run all examples"
34
+ RSpec::Core::RakeTask.new(:spec) do |t|
35
+ t.rspec_path = 'bin/rspec'
36
+ t.rspec_opts = %w[--color]
37
+ t.verbose = false
29
38
  end
30
39
 
31
- class Cucumber::Rake::Task::ForkedCucumberRunner
32
- # When cucumber shells out, we still need it to run in the context of our
33
- # bundle.
34
- def run
35
- sh "bundle exec #{RUBY} " + args.join(" ")
36
- end
37
- end
38
40
 
39
- if RUBY_VERSION.to_f >= 1.9
40
- Cucumber::Rake::Task.new(:cucumber) do |t|
41
- t.cucumber_opts = %w{--format progress}
41
+ namespace :rcov do
42
+ task :cleanup do
43
+ rm_rf 'coverage.data'
42
44
  end
43
45
 
44
- task :default => [:spec, :cucumber]
45
- else
46
- Cucumber::Rake::Task.new(:cucumber) do |t|
46
+ RSpec::Core::RakeTask.new :spec do |t|
47
47
  t.rcov = true
48
- t.rcov_opts = %[-Ilib -Ispec --exclude "mocks,expectations,gems/*,features,spec/ruby_forker,spec/rspec,spec/resources,spec/lib,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*"]
49
- t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
50
- t.cucumber_opts = %w{--format progress}
48
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
49
+ t.rcov_opts << %[--no-html --aggregate coverage.data]
50
+ end
51
+
52
+ if cucumber_loaded
53
+ Cucumber::Rake::Task.new :cucumber do |t|
54
+ t.cucumber_opts = %w{--format progress}
55
+ t.rcov = true
56
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
57
+ t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
58
+ end
59
+ else
60
+ task :cucumber do
61
+ # no-op
62
+ end
51
63
  end
52
64
 
53
- task :default => [:rcov, :cucumber]
65
+ end
66
+
67
+ task :rcov => ["rcov:cleanup", "rcov:spec", "rcov:cucumber"]
68
+
69
+ task :default => [:spec, :cucumber]
70
+
71
+ task :clobber do
72
+ rm_rf 'pkg'
73
+ rm_rf 'tmp'
74
+ rm_rf 'coverage'
75
+ end
76
+
77
+ desc "Push docs/cukes to relishapp using the relish-client-gem"
78
+ task :relish, :version do |t, args|
79
+ raise "rake relish[VERSION]" unless args[:version]
80
+ sh "relish push rspec/rspec-core:#{args[:version]}"
54
81
  end
55
82
 
56
83
  Rake::RDocTask.new do |rdoc|
data/bin/autospec ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rspec/core/deprecation'
3
+ RSpec.warn_deprecation <<-WARNING
4
+ ************************************************************
5
+ REMOVAL NOTICE: you are using behaviour that has been
6
+ removed from rspec-2.
7
+
8
+ * The 'autospec' command is no longer supported.
9
+ * Please use 'autotest' insted.
10
+
11
+ This message will be removed from a future version of rspec.
12
+ ************************************************************
13
+ WARNING
data/bin/rspec CHANGED
@@ -1,3 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
- require 'rspec/core'
3
- exit RSpec::Core::Runner.run(ARGV, $stderr, $stdout)
2
+
3
+ begin
4
+ require 'rspec/autorun'
5
+ rescue LoadError
6
+ $stderr.puts <<-EOS
7
+ #{'*'*50}
8
+ Could not find 'rspec/autorun'
9
+
10
+ This may happen if you're using rubygems as your package manager, but it is not
11
+ being required through some mechanism before executing the rspec command.
12
+
13
+ You may need to do one of the following in your shell:
14
+
15
+ # for bash/zsh
16
+ export RUBYOPT=rubygems
17
+
18
+ # for csh, etc.
19
+ set RUBYOPT=rubygems
20
+
21
+ For background, please see http://gist.github.com/54177.
22
+ #{'*'*50}
23
+ EOS
24
+ exit(1)
25
+ end
data/cucumber.yml CHANGED
@@ -1,2 +1,2 @@
1
- default: --require features --strict --format progress --tags ~@wip features
1
+ default: --require features --strict --format progress --tags ~@wip<%= RUBY_PLATFORM == 'java' ? ' --tags ~@no-jruby' : '' %> features
2
2
  wip: --require features --tags @wip:3 --wip features
data/features/.nav ADDED
@@ -0,0 +1,57 @@
1
+ - Upgrade.md
2
+ - Changelog.md
3
+ - Autotest.md
4
+ - example_groups:
5
+ - basic_structure.feature
6
+ - shared_example_group.feature
7
+ - shared_context.feature
8
+ - command_line:
9
+ - configure.feature
10
+ - example_name_option.feature
11
+ - format_option.feature
12
+ - line_number_option.feature
13
+ - tag.feature
14
+ - line_number_appended_to_path.feature
15
+ - exit_status.feature
16
+ - rake_task.feature
17
+ - pending:
18
+ - pending_examples.feature
19
+ - hooks:
20
+ - before_and_after_hooks.feature
21
+ - around_hooks.feature
22
+ - filtering.feature
23
+ - subject:
24
+ - implicit_subject.feature
25
+ - explicit_subject.feature
26
+ - attribute_of_subject.feature
27
+ - implicit_receiver.feature
28
+ - helper_methods:
29
+ - let.feature
30
+ - arbitrary_methods.feature
31
+ - modules.feature
32
+ - metadata:
33
+ - current_example.feature
34
+ - described_class.feature
35
+ - user_defined.feature
36
+ - filtering:
37
+ - inclusion_filters.feature
38
+ - exclusion_filters.feature
39
+ - if_and_unless.feature
40
+ - run_all_when_everything_filtered.feature
41
+ - configuration:
42
+ - read_options_from_file.feature
43
+ - fail_fast.feature
44
+ - custom_settings.feature
45
+ - alias_example_to.feature
46
+ - expectation_framework_integration:
47
+ - configure_expectation_framework.feature
48
+ - mock_framework_integration:
49
+ - use_rspec.feature
50
+ - use_flexmock.feature
51
+ - use_mocha.feature
52
+ - use_rr.feature
53
+ - use_any_framework.feature
54
+ - formatters:
55
+ - custom_formatter.feature
56
+ - spec_files:
57
+ - arbitrary_file_suffix.feature
@@ -0,0 +1,38 @@
1
+ RSpec ships with a specialized subclass of Autotest. To use it, just add a
2
+ `.rspec` file to your project's root directory, and run the `autotest` command
3
+ as normal:
4
+
5
+ $ autotest
6
+
7
+ ## Bundler
8
+
9
+ The `autotest` command generates a shell command that runs your specs. If you
10
+ are using Bundler, and you want the shell command to include `bundle exec`,
11
+ require the Autotest bundler plugin in a `.autotest` file in the project's root
12
+ directory or your home directory:
13
+
14
+ # in .autotest
15
+ require "autotest/bundler"
16
+
17
+ ## Upgrading from previous versions of rspec
18
+
19
+ Previous versions of RSpec used a different mechanism for telling autotest to
20
+ invoke RSpec's Autotest extension: it generated an `autotest/discover.rb` file
21
+ in the project's root directory. This is no longer necessary with the new
22
+ approach of RSpec looking for a `.rspec` file, so feel free to delete the
23
+ `autotest/discover.rb` file in the project root if you have one.
24
+
25
+ ## Gotchas
26
+
27
+ ### Invalid Option: --tty
28
+
29
+ The `--tty` option was [added in rspec-core-2.2.1](changelog), and is used
30
+ internally by RSpec. If you see an error citing it as an invalid option, you'll
31
+ probably see there are two or more versions of rspec-core in the backtrace: one
32
+ < 2.2.1 and one >= 2.2.1.
33
+
34
+ This usually happens because you have a newer rspec-core installed, and an
35
+ older rspec-core specified in a Bundler Gemfile. If this is the case, you can:
36
+
37
+ 1. specify the newer version in the Gemfile (recommended)
38
+ 2. prefix the `autotest` command with `bundle exec`
@@ -0,0 +1,269 @@
1
+ ### 2.6.0 / 2011-05-12
2
+
3
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.5.1...v2.6.0)
4
+
5
+ * Enhancements
6
+ * `shared_context` (Damian Nurzynski)
7
+ * extend groups matching specific metadata with:
8
+ * method definitions
9
+ * subject declarations
10
+ * let/let! declarations
11
+ * etc (anything you can do in a group)
12
+ * `its([:key])` works for any subject with #[]. (Peter Jaros)
13
+ * `treat_symbols_as_metadata_keys_with_true_values` (Myron Marston)
14
+ * Print a deprecation warning when you configure RSpec after defining
15
+ an example. All configuration should happen before any examples are
16
+ defined. (Myron Marston)
17
+ * Pass the exit status of a DRb run to the invoking process. This causes
18
+ specs run via DRb to not just return true or false. (Ilkka Laukkanen)
19
+ * Refactoring of `ConfigurationOptions#parse_options` (Rodrigo Rosenfeld Rosas)
20
+ * Report excluded filters in runner output (tip from andyl)
21
+ * Clean up messages for filters/tags.
22
+ * Restore --pattern/-P command line option from rspec-1
23
+ * Support false as well as true in config.full_backtrace= (Andreas Tolf Tolfsen)
24
+
25
+ * Bug fixes
26
+ * Don't stumble over an exception without a message (Hans Hasselberg)
27
+ * Remove non-ascii characters from comments that were choking rcov (Geoffrey
28
+ Byers)
29
+ * Fixed backtrace so it doesn't include lines from before the autorun at_exit
30
+ hook (Myron Marston)
31
+ * Include RSpec::Matchers when first example group is defined, rather
32
+ than just before running the examples. This works around an obscure
33
+ bug in ruby 1.9 that can cause infinite recursion. (Myron Marston)
34
+ * Don't send `example_group_[started|finished]` to formatters for empty groups.
35
+ * Get specs passing on jruby (Sidu Ponnappa)
36
+ * Fix bug where mixing nested groups and outer-level examples gave
37
+ unpredictable :line_number behavior (Artur Małecki)
38
+ * Regexp.escape the argument to --example (tip from Elliot Winkler)
39
+ * Correctly pass/fail pending block with message expectations
40
+ * CommandLine returns exit status (0/1) instead of true/false
41
+ * Create path to formatter output file if it doesn't exist (marekj).
42
+
43
+
44
+ ### 2.5.1 / 2011-02-06
45
+
46
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.5.0...v2.5.1)
47
+
48
+ NOTE: this release breaks compatibility with rspec/autotest/bundler
49
+ integration, but does so in order to greatly simplify it.
50
+
51
+ With this release, if you want the generated autotest command to include
52
+ 'bundle exec', require Autotest's bundler plugin in a .autotest file in the
53
+ project's root directory or in your home directory:
54
+
55
+ require "autotest/bundler"
56
+
57
+ Now you can just type 'autotest' on the commmand line and it will work as you expect.
58
+
59
+ If you don't want 'bundle exec', there is nothing you have to do.
60
+
61
+ ### 2.5.0 / 2011-02-05
62
+
63
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.4.0...v2.5.0)
64
+
65
+ * Enhancements
66
+ * Autotest::Rspec2 parses command line args passed to autotest after '--'
67
+ * --skip-bundler option for autotest command
68
+ * Autotest regexp fixes (Jon Rowe)
69
+ * Add filters to html and textmate formatters (Daniel Quimper)
70
+ * Explicit passing of block (need for JRuby 1.6) (John Firebaugh)
71
+
72
+ * Bug fixes
73
+ * fix dom IDs in HTML formatter (Brian Faherty)
74
+ * fix bug with --drb + formatters when not running in drb
75
+ * include --tag options in drb args (monocle)
76
+ * fix regression so now SPEC_OPTS take precedence over CLI options again
77
+ (Roman Chernyatchik)
78
+ * only call its(:attribute) once (failing example from Brian Dunn)
79
+ * fix bizarre bug where rspec would hang after String.alias :to_int :to_i
80
+ (Damian Nurzynski)
81
+
82
+ * Deprecations
83
+ * implicit inclusion of 'bundle exec' when Gemfile present (use autotest's
84
+ bundler plugin instead)
85
+
86
+ ### 2.4.0 / 2011-01-02
87
+
88
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.3.1...v2.4.0)
89
+
90
+ * Enhancements
91
+ * start the debugger on -d so the stack trace is visible when it stops
92
+ (Clifford Heath)
93
+ * apply hook filtering to examples as well as groups (Myron Marston)
94
+ * support multiple formatters, each with their own output
95
+ * show exception classes in failure messages unless they come from RSpec
96
+ matchers or message expectations
97
+ * before(:all) { pending } sets all examples to pending
98
+
99
+ * Bug fixes
100
+ * fix bug due to change in behavior of reject in Ruby 1.9.3-dev (Shota Fukumori)
101
+ * fix bug when running in jruby: be explicit about passing block to super
102
+ (John Firebaugh)
103
+ * rake task doesn't choke on paths with quotes (Janmejay Singh)
104
+ * restore --options option from rspec-1
105
+ * require 'ostruct' to fix bug with its([key]) (Kim Burgestrand)
106
+ * --configure option generates .rspec file instead of autotest/discover.rb
107
+
108
+ ### 2.3.1 / 2010-12-16
109
+
110
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.3.0...v2.3.1)
111
+
112
+ * Bug fixes
113
+ * send debugger warning message to $stdout if RSpec.configuration.error_stream
114
+ has not been defined yet.
115
+ * HTML Formatter _finally_ properly displays nested groups (Jarmo Pertman)
116
+ * eliminate some warnings when running RSpec's own suite (Jarmo Pertman)
117
+
118
+ ### 2.3.0 / 2010-12-12
119
+
120
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.2.1...v2.3.0)
121
+
122
+ * Enhancements
123
+ * tell autotest to use "rspec2" if it sees a .rspec file in the project's
124
+ root directory
125
+ * replaces the need for ./autotest/discover.rb, which will not work with
126
+ all versions of ZenTest and/or autotest
127
+ * config.expect_with
128
+ * :rspec # => rspec/expectations
129
+ * :stdlib # => test/unit/assertions
130
+ * :rspec, :stdlib # => both
131
+
132
+ * Bug fixes
133
+ * fix dev Gemfile to work on non-mac-os machines (Lake Denman)
134
+ * ensure explicit subject is only eval'd once (Laszlo Bacsi)
135
+
136
+ ### 2.2.1 / 2010-11-28
137
+
138
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.2.0...v2.2.1)
139
+
140
+ * Bug fixes
141
+ * alias_method instead of override Kernel#method_missing (John Wilger)
142
+ * changed --autotest to --tty in generated command (MIKAMI Yoshiyuki)
143
+ * revert change to debugger (had introduced conflict with Rails)
144
+ * also restored --debugger/-debug option
145
+
146
+ ### 2.2.0 / 2010-11-28
147
+
148
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.1.0...v2.2.0)
149
+
150
+ * Deprecations/changes
151
+ * --debug/-d on command line is deprecated and now has no effect
152
+ * win32console is now ignored; Windows users must use ANSICON for color support
153
+ (Bosko Ivanisevic)
154
+
155
+ * Enhancements
156
+ * When developing locally rspec-core now works with the rspec-dev setup or your local gems
157
+ * Raise exception with helpful message when rspec-1 is loaded alongside
158
+ rspec-2 (Justin Ko)
159
+ * debugger statements _just work_ as long as ruby-debug is installed
160
+ * otherwise you get warned, but not fired
161
+ * Expose example.metadata in around hooks
162
+ * Performance improvments (much faster now)
163
+
164
+ * Bug fixes
165
+ * Make sure --fail-fast makes it across drb
166
+ * Pass -Ilib:spec to rcov
167
+
168
+ ### 2.1.0 / 2010-11-07
169
+
170
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.1...v2.1.0)
171
+
172
+ * Enhancments
173
+ * Add skip_bundler option to rake task to tell rake task to ignore the
174
+ presence of a Gemfile (jfelchner)
175
+ * Add gemfile option to rake task to tell rake task what Gemfile to look
176
+ for (defaults to 'Gemfile')
177
+ * Allow passing caller trace into Metadata to support extensions (Glenn
178
+ Vanderburg)
179
+ * Add deprecation warning for Spec::Runner.configure to aid upgrade from
180
+ RSpec-1
181
+ * Add deprecated Spec::Rake::SpecTask to aid upgrade from RSpec-1
182
+ * Add 'autospec' command with helpful message to aid upgrade from RSpec-1
183
+ * Add support for filtering with tags on CLI (Lailson Bandeira)
184
+ * Add a helpful message about RUBYOPT when require fails in bin/rspec
185
+ (slyphon)
186
+ * Add "-Ilib" to the default rcov options (Tianyi Cui)
187
+ * Make the expectation framework configurable (default rspec, of course)
188
+ (Justin Ko)
189
+ * Add 'pending' to be conditional (Myron Marston)
190
+ * Add explicit support for :if and :unless as metadata keys for conditional run
191
+ of examples (Myron Marston)
192
+ * Add --fail-fast command line option (Jeff Kreeftmeijer)
193
+
194
+ * Bug fixes
195
+ * Eliminate stack overflow with "subject { self }"
196
+ * Require 'rspec/core' in the Raketask (ensures it required when running rcov)
197
+
198
+ ### 2.0.1 / 2010-10-18
199
+
200
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0...v2.0.1)
201
+
202
+ * Bug fixes
203
+ * Restore color when using spork + autotest
204
+ * Pending examples without docstrings render the correct message (Josep M. Bach)
205
+ * Fixed bug where a failure in a spec file ending in anything but _spec.rb would
206
+ fail in a confusing way.
207
+ * Support backtrace lines from erb templates in html formatter (Alex Crichton)
208
+
209
+ ### 2.0.0 / 2010-10-10
210
+
211
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0.rc...v2.0.0)
212
+
213
+ * RSpec-1 compatibility
214
+ * Rake task uses ENV["SPEC"] as file list if present
215
+
216
+ * Bug fixes
217
+ * Bug Fix: optparse --out foo.txt (Leonardo Bessa)
218
+ * Suppress color codes for non-tty output (except autotest)
219
+
220
+ ### 2.0.0.rc / 2010-10-05
221
+
222
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0.beta.22...v2.0.0.rc)
223
+
224
+ * Enhancements
225
+ * implicitly require unknown formatters so you don't have to require the
226
+ file explicitly on the commmand line (Michael Grosser)
227
+ * add --out/-o option to assign output target
228
+ * added fail_fast configuration option to abort on first failure
229
+ * support a Hash subject (its([:key]) { should == value }) (Josep M. Bach)
230
+
231
+ * Bug fixes
232
+ * Explicitly require rspec version to fix broken rdoc task (Hans de Graaff)
233
+ * Ignore backtrace lines that come from other languages, like Java or
234
+ Javascript (Charles Lowell)
235
+ * Rake task now does what is expected when setting (or not setting)
236
+ fail_on_error and verbose
237
+ * Fix bug in which before/after(:all) hooks were running on excluded nested
238
+ groups (Myron Marston)
239
+ * Fix before(:all) error handling so that it fails examples in nested groups,
240
+ too (Myron Marston)
241
+
242
+ ### 2.0.0.beta.22 / 2010-09-12
243
+
244
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0.beta.20...v2.0.0.beta.22)
245
+
246
+ * Enhancements
247
+ * removed at_exit hook
248
+ * CTRL-C stops the run (almost) immediately
249
+ * first it cleans things up by running the appropriate after(:all) and after(:suite) hooks
250
+ * then it reports on any examples that have already run
251
+ * cleaned up rake task
252
+ * generate correct task under variety of conditions
253
+ * options are more consistent
254
+ * deprecated redundant options
255
+ * run 'bundle exec autotest' when Gemfile is present
256
+ * support ERB in .rspec options files (Justin Ko)
257
+ * depend on bundler for development tasks (Myron Marston)
258
+ * add example_group_finished to formatters and reporter (Roman Chernyatchik)
259
+
260
+ * Bug fixes
261
+ * support paths with spaces when using autotest (Andreas Neuhaus)
262
+ * fix module_exec with ruby 1.8.6 (Myron Marston)
263
+ * remove context method from top-level
264
+ * was conflicting with irb, for example
265
+ * errors in before(:all) are now reported correctly (Chad Humphries)
266
+
267
+ * Removals
268
+ * removed -o --options-file command line option
269
+ * use ./.rspec and ~/.rspec