rspec-core 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/Gemfile +16 -11
  2. data/History.markdown +22 -0
  3. data/License.txt +2 -1
  4. data/{README.markdown → README.md} +11 -3
  5. data/Rakefile +1 -0
  6. data/Upgrade.markdown +35 -2
  7. data/features/hooks/around_hooks.feature +18 -2
  8. data/lib/rspec/core/configuration.rb +38 -36
  9. data/lib/rspec/core/configuration_options.rb +2 -1
  10. data/lib/rspec/core/deprecation.rb +1 -1
  11. data/lib/rspec/core/example.rb +19 -9
  12. data/lib/rspec/core/example_group.rb +14 -26
  13. data/lib/rspec/core/extensions/kernel.rb +23 -3
  14. data/lib/rspec/core/formatters/base_text_formatter.rb +43 -30
  15. data/lib/rspec/core/formatters/documentation_formatter.rb +1 -1
  16. data/lib/rspec/core/formatters/html_formatter.rb +10 -8
  17. data/lib/rspec/core/hooks.rb +2 -2
  18. data/lib/rspec/core/metadata.rb +46 -34
  19. data/lib/rspec/core/option_parser.rb +2 -2
  20. data/lib/rspec/core/rake_task.rb +1 -1
  21. data/lib/rspec/core/ruby_project.rb +2 -2
  22. data/lib/rspec/core/runner.rb +2 -2
  23. data/lib/rspec/core/subject.rb +4 -3
  24. data/lib/rspec/core/version.rb +1 -1
  25. data/rspec-core.gemspec +1 -1
  26. data/spec/rspec/core/configuration_options_spec.rb +7 -5
  27. data/spec/rspec/core/configuration_spec.rb +58 -69
  28. data/spec/rspec/core/example_group_spec.rb +22 -7
  29. data/spec/rspec/core/example_spec.rb +1 -1
  30. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +2 -2
  31. data/spec/rspec/core/kernel_extensions_spec.rb +6 -3
  32. data/spec/rspec/core/metadata_spec.rb +13 -0
  33. data/spec/rspec/core/pending_example_spec.rb +1 -1
  34. data/spec/rspec/core/rake_task_spec.rb +2 -3
  35. data/spec/spec_helper.rb +1 -0
  36. metadata +9 -11
  37. data/.treasure_map.rb +0 -23
  38. data/specs.watchr +0 -58
data/.treasure_map.rb DELETED
@@ -1,23 +0,0 @@
1
- Beholder.runner = 'clear; ruby -Ilib -Ispec'
2
-
3
- map_for(:rspec_core) do |m|
4
-
5
- m.watch 'lib', 'spec', 'example_specs'
6
-
7
- m.add_mapping %r%example_specs/(.*)_spec\.rb% do |match|
8
- ["example_specs/#{match[1]}_spec.rb"]
9
- end
10
-
11
- m.add_mapping %r%spec/(.*)_spec\.rb% do |match|
12
- ["spec/#{match[1]}_spec.rb"]
13
- end
14
-
15
- m.add_mapping %r%spec/spec_helper\.rb% do |match|
16
- Dir["spec/**/*_spec.rb"]
17
- end
18
-
19
- m.add_mapping %r%lib/(.*)\.rb% do |match|
20
- tests_matching match[1]
21
- end
22
-
23
- end
data/specs.watchr DELETED
@@ -1,58 +0,0 @@
1
- # Run me with:
2
- #
3
- # $ watchr specs.watchr
4
-
5
- # --------------------------------------------------
6
- # Convenience Methods
7
- # --------------------------------------------------
8
- def all_spec_files
9
- Dir['spec/**/*_spec.rb']
10
- end
11
-
12
- def run_spec_matching(thing_to_match)
13
- matches = all_spec_files.grep(/#{thing_to_match}/i)
14
- if matches.empty?
15
- puts "Sorry, thanks for playing, but there were no matches for #{thing_to_match}"
16
- else
17
- run matches.join(' ')
18
- end
19
- end
20
-
21
- def run(files_to_run)
22
- puts("Running: #{files_to_run}")
23
- system("clear;ruby -Ilib bin/rspec -c #{files_to_run}")
24
- no_int_for_you
25
- end
26
-
27
- def run_all_specs
28
- run(all_spec_files.join(' '))
29
- end
30
-
31
- # --------------------------------------------------
32
- # Watchr Rules
33
- # --------------------------------------------------
34
- watch('^spec/(.*)_spec\.rb') { |m| run_spec_matching(m[1]) }
35
- watch('^lib/(.*)\.rb') { |m| run_spec_matching(m[1]) }
36
- watch('^spec/spec_helper\.rb') { run_all_specs }
37
- watch('^spec/support/.*\.rb') { run_all_specs }
38
-
39
- # --------------------------------------------------
40
- # Signal Handling
41
- # --------------------------------------------------
42
- def no_int_for_you
43
- @sent_an_int = nil
44
- end
45
-
46
- Signal.trap 'INT' do
47
- if @sent_an_int then
48
- puts " A second INT? Ok, I get the message. Shutting down now."
49
- exit
50
- else
51
- puts " Did you just send me an INT? Ugh. I'll quit for real if you do it again."
52
- @sent_an_int = true
53
- Kernel.sleep 1.5
54
- run_all_specs
55
- end
56
- end
57
-
58
- # vim:ft=ruby