rspec-core 2.0.0.beta.8 → 2.0.0.beta.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/README.markdown +8 -8
  2. data/Rakefile +9 -9
  3. data/Upgrade.markdown +6 -6
  4. data/VERSION +1 -1
  5. data/cucumber.yml +2 -7
  6. data/example_specs/passing/subject_example.rb +45 -0
  7. data/example_specs/spec_helper.rb +1 -1
  8. data/features/command_line/line_number_appended_to_path.feature +11 -13
  9. data/features/command_line/line_number_option.feature +3 -3
  10. data/features/configuration/custom_options.feature +71 -0
  11. data/features/configuration/options_file.feature +13 -13
  12. data/features/example_groups/describe_aliases.feature +1 -1
  13. data/features/example_groups/nested_groups.feature +4 -5
  14. data/features/filtering/inclusion_filters.feature +74 -0
  15. data/features/formatters/custom_formatter.feature +1 -1
  16. data/features/hooks/around_hook.feature +1 -1
  17. data/features/hooks/before_and_after_hooks.feature +61 -33
  18. data/features/hooks/described_class.feature +1 -1
  19. data/features/hooks/halt.feature +2 -2
  20. data/features/mock_framework_integration/use_flexmock.feature +2 -2
  21. data/features/mock_framework_integration/use_mocha.feature +2 -2
  22. data/features/mock_framework_integration/use_rr.feature +2 -2
  23. data/features/mock_framework_integration/use_rspec.feature +2 -2
  24. data/features/pending/pending_examples.feature +5 -5
  25. data/features/subject/explicit_subject.feature +4 -4
  26. data/features/subject/implicit_subject.feature +2 -2
  27. data/features/support/env.rb +1 -1
  28. data/lib/autotest/rspec2.rb +1 -1
  29. data/lib/rspec/autorun.rb +1 -1
  30. data/lib/rspec/core.rb +16 -9
  31. data/lib/rspec/core/around_proxy.rb +1 -1
  32. data/lib/rspec/core/backward_compatibility.rb +29 -1
  33. data/lib/rspec/core/configuration.rb +24 -16
  34. data/lib/rspec/core/configuration_options.rb +2 -2
  35. data/lib/rspec/core/deprecation.rb +3 -3
  36. data/lib/rspec/core/errors.rb +1 -1
  37. data/lib/rspec/core/example.rb +10 -3
  38. data/lib/rspec/core/example_group.rb +83 -58
  39. data/lib/rspec/core/formatters.rb +1 -1
  40. data/lib/rspec/core/formatters/base_formatter.rb +4 -4
  41. data/lib/rspec/core/formatters/base_text_formatter.rb +3 -3
  42. data/lib/rspec/core/formatters/documentation_formatter.rb +6 -9
  43. data/lib/rspec/core/formatters/helpers.rb +5 -4
  44. data/lib/rspec/core/formatters/progress_formatter.rb +1 -1
  45. data/lib/rspec/core/hooks.rb +1 -1
  46. data/lib/rspec/core/kernel_extensions.rb +3 -23
  47. data/lib/rspec/core/let.rb +73 -5
  48. data/lib/rspec/core/load_path.rb +1 -1
  49. data/lib/rspec/core/metadata.rb +20 -8
  50. data/lib/rspec/core/mocking/with_absolutely_nothing.rb +1 -1
  51. data/lib/rspec/core/mocking/with_flexmock.rb +1 -1
  52. data/lib/rspec/core/mocking/with_mocha.rb +1 -1
  53. data/lib/rspec/core/mocking/with_rr.rb +2 -2
  54. data/lib/rspec/core/mocking/with_rspec.rb +3 -3
  55. data/lib/rspec/core/object_extensions.rb +15 -0
  56. data/lib/rspec/core/pending.rb +2 -2
  57. data/lib/rspec/core/rake_task.rb +2 -2
  58. data/lib/rspec/core/ruby_project.rb +1 -1
  59. data/lib/rspec/core/runner.rb +13 -8
  60. data/lib/rspec/core/shared_example_group.rb +16 -6
  61. data/lib/rspec/core/subject.rb +23 -7
  62. data/lib/rspec/core/version.rb +1 -1
  63. data/lib/rspec/core/world.rb +45 -38
  64. data/rspec-core.gemspec +17 -11
  65. data/spec/autotest/failed_results_re_spec.rb +1 -1
  66. data/spec/rspec/core/configuration_options_spec.rb +17 -7
  67. data/spec/rspec/core/configuration_spec.rb +46 -18
  68. data/spec/rspec/core/deprecations_spec.rb +8 -0
  69. data/spec/rspec/core/example_group_spec.rb +194 -56
  70. data/spec/rspec/core/example_spec.rb +18 -6
  71. data/spec/rspec/core/formatters/base_formatter_spec.rb +2 -2
  72. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +18 -2
  73. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +29 -4
  74. data/spec/rspec/core/formatters/helpers_spec.rb +18 -11
  75. data/spec/rspec/core/formatters/progress_formatter_spec.rb +2 -2
  76. data/spec/rspec/core/kernel_extensions_spec.rb +5 -9
  77. data/spec/rspec/core/metadata_spec.rb +29 -8
  78. data/spec/rspec/core/pending_example_spec.rb +7 -7
  79. data/spec/rspec/core/ruby_project_spec.rb +1 -1
  80. data/spec/rspec/core/runner_spec.rb +9 -9
  81. data/spec/rspec/core/shared_example_group_spec.rb +3 -3
  82. data/spec/rspec/core/subject_spec.rb +1 -1
  83. data/spec/rspec/core/world_spec.rb +16 -35
  84. data/spec/rspec/core_spec.rb +9 -9
  85. data/spec/spec_helper.rb +11 -13
  86. data/spec/support/matchers.rb +2 -2
  87. data/specs.watchr +11 -11
  88. metadata +16 -10
@@ -4,7 +4,7 @@
4
4
 
5
5
  require 'pathname'
6
6
 
7
- module Rspec
7
+ module RSpec
8
8
  module Core
9
9
  module RubyProject
10
10
  def add_to_load_path(*dirs)
@@ -1,4 +1,4 @@
1
- module Rspec
1
+ module RSpec
2
2
  module Core
3
3
  class Runner
4
4
 
@@ -13,18 +13,23 @@ module Rspec
13
13
  end
14
14
 
15
15
  def configuration
16
- Rspec.configuration
16
+ RSpec.configuration
17
17
  end
18
18
 
19
19
  def reporter
20
20
  configuration.formatter
21
21
  end
22
22
 
23
+ def inclusion_filter
24
+ RSpec.configuration.filter
25
+ end
26
+
23
27
  def run(args = [])
24
28
  configure(args)
25
-
29
+ RSpec.world.announce_inclusion_filter
30
+
26
31
  reporter.report(example_count) do |reporter|
27
- example_groups.run_all(reporter)
32
+ example_groups.run_examples(reporter)
28
33
  end
29
34
 
30
35
  example_groups.success?
@@ -33,21 +38,21 @@ module Rspec
33
38
  private
34
39
 
35
40
  def configure(args)
36
- Rspec::Core::ConfigurationOptions.new(args).apply_to(configuration)
41
+ RSpec::Core::ConfigurationOptions.new(args).apply_to(configuration)
37
42
  configuration.require_files_to_run
38
43
  configuration.configure_mock_framework
39
44
  end
40
45
 
41
46
  def example_count
42
- Rspec::Core.world.total_examples_to_run
47
+ RSpec.world.example_count
43
48
  end
44
49
 
45
50
  def example_groups
46
- Rspec::Core.world.example_groups_to_run.extend(ExampleGroups)
51
+ RSpec.world.example_groups.extend(ExampleGroups)
47
52
  end
48
53
 
49
54
  module ExampleGroups
50
- def run_all(reporter)
55
+ def run_examples(reporter)
51
56
  @success = self.inject(true) {|success, group| success &= group.run(reporter)}
52
57
  end
53
58
 
@@ -1,19 +1,25 @@
1
- module Rspec
1
+ module RSpec
2
2
  module Core
3
3
  module SharedExampleGroup
4
4
 
5
5
  def share_examples_for(name, &block)
6
6
  ensure_shared_example_group_name_not_taken(name)
7
- Rspec::Core.world.shared_example_groups[name] = block
7
+ RSpec.world.shared_example_groups[name] = block
8
8
  end
9
9
 
10
10
  def share_as(name, &block)
11
11
  if Object.const_defined?(name)
12
- raise NameError, "The first argument (#{name}) to share_as must be a legal name for a constant not already in use."
12
+ mod = Object.const_get(name)
13
+ raise_name_error unless mod.created_from_caller(caller)
13
14
  end
14
15
 
15
16
  mod = Module.new do
16
17
  @shared_block = block
18
+ @caller_line = caller.last
19
+
20
+ def self.created_from_caller(other_caller)
21
+ @caller_line == other_caller.last
22
+ end
17
23
 
18
24
  def self.included(kls)
19
25
  kls.module_eval(&@shared_block)
@@ -21,15 +27,19 @@ module Rspec
21
27
  end
22
28
 
23
29
  shared_const = Object.const_set(name, mod)
24
- Rspec::Core.world.shared_example_groups[shared_const] = block
30
+ RSpec.world.shared_example_groups[shared_const] = block
25
31
  end
26
32
 
27
33
  alias :shared_examples_for :share_examples_for
28
34
 
29
35
  private
30
36
 
37
+ def raise_name_error
38
+ raise NameError, "The first argument (#{name}) to share_as must be a legal name for a constant not already in use."
39
+ end
40
+
31
41
  def ensure_shared_example_group_name_not_taken(name)
32
- if Rspec::Core.world.shared_example_groups.has_key?(name)
42
+ if RSpec.world.shared_example_groups.has_key?(name)
33
43
  raise ArgumentError.new("Shared example group '#{name}' already exists")
34
44
  end
35
45
  end
@@ -38,4 +48,4 @@ module Rspec
38
48
  end
39
49
  end
40
50
 
41
- include Rspec::Core::SharedExampleGroup
51
+ include RSpec::Core::SharedExampleGroup
@@ -1,17 +1,17 @@
1
- module Rspec
1
+ module RSpec
2
2
  module Core
3
3
  module Subject
4
-
4
+
5
5
  def self.included(kls)
6
6
  kls.extend ClassMethods
7
7
  kls.__send__ :alias_method, :__should_for_example_group__, :should
8
8
  kls.__send__ :alias_method, :__should_not_for_example_group__, :should_not
9
9
  end
10
-
10
+
11
11
  def subject
12
- @subject ||= instance_eval(&self.class.subject)
12
+ attribute_of_subject || original_subject
13
13
  end
14
-
14
+
15
15
  # When +should+ is called with no explicit receiver, the call is
16
16
  # delegated to the object returned by +subject+. Combined with
17
17
  # an implicit subject (see +subject+), this supports very concise
@@ -37,7 +37,7 @@ module Rspec
37
37
  def should_not(matcher=nil, message=nil)
38
38
  self == subject ? self.__should_not_for_example_group__(matcher) : subject.should_not(matcher,message)
39
39
  end
40
-
40
+
41
41
  module ClassMethods
42
42
  # Defines an explicit subject for an example group which can then be the
43
43
  # implicit receiver (through delegation) of calls to +should+.
@@ -54,7 +54,7 @@ module Rspec
54
54
  def subject(&block)
55
55
  block ? @explicit_subject_block = block : explicit_subject || implicit_subject
56
56
  end
57
-
57
+
58
58
  attr_reader :explicit_subject_block # :nodoc:
59
59
 
60
60
  private
@@ -72,6 +72,22 @@ module Rspec
72
72
  Class === described ? proc { described.new } : proc { described }
73
73
  end
74
74
  end
75
+
76
+ private
77
+
78
+ def original_subject
79
+ @original_subject ||= instance_eval(&self.class.subject)
80
+ end
81
+
82
+ def attribute_of_subject
83
+ original_subject.send(running_example.description) if using_attribute?
84
+ end
85
+
86
+ def using_attribute?
87
+ running_example.in_block? &&
88
+ running_example.metadata[:attribute_of_subject]
89
+ end
90
+
75
91
  end
76
92
  end
77
93
  end
@@ -1,4 +1,4 @@
1
- module Rspec # :nodoc:
1
+ module RSpec # :nodoc:
2
2
  module Core # :nodoc:
3
3
  module Version # :nodoc:
4
4
  STRING = File.readlines(File.expand_path('../../../../VERSION', __FILE__)).first
@@ -1,58 +1,43 @@
1
- module Rspec
1
+ module RSpec
2
2
  module Core
3
3
  class World
4
4
 
5
- attr_reader :example_groups
5
+ attr_reader :example_groups, :filtered_examples
6
6
 
7
7
  def initialize
8
8
  @example_groups = []
9
+ @filtered_examples = Hash.new { |hash,group|
10
+ hash[group] = begin
11
+ examples = group.examples.dup
12
+ examples = apply_exclusion_filters(examples, exclusion_filter) if exclusion_filter
13
+ examples = apply_inclusion_filters(examples, inclusion_filter) if inclusion_filter
14
+ examples.uniq
15
+ end
16
+ }
9
17
  end
10
18
 
11
- def inclusion_filter
12
- Rspec.configuration.filter
19
+ def configuration
20
+ RSpec.configuration
13
21
  end
14
22
 
15
- def exclusion_filter
16
- Rspec.configuration.exclusion_filter
17
- end
18
-
19
- def shared_example_groups
20
- @shared_example_groups ||= {}
23
+ def inclusion_filter
24
+ configuration.filter
21
25
  end
22
26
 
23
- def example_groups_to_run
24
- @example_groups_to_run ||= begin
25
- if inclusion_filter || exclusion_filter
26
- if Rspec.configuration.run_all_when_everything_filtered? && filtered_example_groups.empty?
27
- Rspec.configuration.puts "No examples were matched by #{inclusion_filter.inspect}, running all"
28
- all_example_groups
29
- else
30
- Rspec.configuration.puts "Run filtered using #{inclusion_filter.inspect}"
31
- filtered_example_groups
32
- end
33
- else
34
- all_example_groups
35
- end
36
- end
27
+ def exclusion_filter
28
+ configuration.exclusion_filter
37
29
  end
38
30
 
39
- def all_example_groups
40
- @example_groups.each { |g| g.examples_to_run.replace(g.examples) }
31
+ def find_modules(group)
32
+ configuration.find_modules(group)
41
33
  end
42
34
 
43
- def total_examples_to_run
44
- @total_examples_to_run ||= example_groups_to_run.inject(0) { |sum, g| sum += g.examples_to_run.size }
35
+ def shared_example_groups
36
+ @shared_example_groups ||= {}
45
37
  end
46
38
 
47
- def filtered_example_groups
48
- @filtered_example_groups ||= example_groups.select do |example_group|
49
- examples = example_group.examples
50
- examples = apply_exclusion_filters(examples, exclusion_filter) if exclusion_filter
51
- examples = apply_inclusion_filters(examples, inclusion_filter) if inclusion_filter
52
- examples.uniq!
53
- example_group.examples_to_run.replace(examples)
54
- !examples.empty?
55
- end
39
+ def example_count
40
+ example_groups.collect {|g| g.descendents}.flatten.inject(0) { |sum, g| sum += g.filtered_examples.size }
56
41
  end
57
42
 
58
43
  def apply_inclusion_filters(examples, conditions={})
@@ -65,12 +50,34 @@ module Rspec
65
50
  examples.reject &all_apply?(conditions)
66
51
  end
67
52
 
68
- def preceding_example_or_group_line(filter_line)
53
+ def preceding_declaration_line(filter_line)
69
54
  declaration_line_numbers.inject(nil) do |highest_prior_declaration_line, line|
70
55
  line <= filter_line ? line : highest_prior_declaration_line
71
56
  end
72
57
  end
58
+
59
+ def announce_inclusion_filter
60
+ if inclusion_filter
61
+ if RSpec.configuration.run_all_when_everything_filtered? && RSpec.world.example_count == 0
62
+ RSpec.configuration.puts "No examples were matched by #{inclusion_filter.inspect}, running all"
63
+ RSpec.configuration.clear_inclusion_filter
64
+ filtered_examples.clear
65
+ else
66
+ RSpec.configuration.puts "Run filtered using #{inclusion_filter.inspect}"
67
+ end
68
+ end
69
+ end
73
70
 
71
+ def run_hook(hook, scope, group, example)
72
+ find_hook(hook, scope, group).each { |blk| example.instance_eval(&blk) }
73
+ end
74
+
75
+ def find_hook(hook, scope, group)
76
+ RSpec.configuration.hooks[hook][scope].select do |filters, block|
77
+ group.all_apply?(filters)
78
+ end.map { |filters, block| block }
79
+ end
80
+
74
81
  private
75
82
 
76
83
  def all_apply?(conditions)
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rspec-core}
8
- s.version = "2.0.0.beta.8"
8
+ s.version = "2.0.0.beta.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Chad Humphries", "David Chelimsky"]
12
- s.date = %q{2010-04-27}
13
- s.description = %q{Rspec runner and example group classes}
12
+ s.date = %q{2010-05-27}
13
+ s.description = %q{RSpec runner and example group classes}
14
14
  s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
15
15
  s.executables = ["rspec", "spec"]
16
16
  s.extra_rdoc_files = [
@@ -75,15 +75,18 @@ Gem::Specification.new do |s|
75
75
  "example_specs/passing/stack_spec.rb",
76
76
  "example_specs/passing/stack_spec_with_nested_example_groups.rb",
77
77
  "example_specs/passing/stubbing_example.rb",
78
+ "example_specs/passing/subject_example.rb",
78
79
  "example_specs/passing/yielding_example.rb",
79
80
  "example_specs/ruby1.9.compatibility/access_to_constants_spec.rb",
80
81
  "example_specs/spec_helper.rb",
81
82
  "features/command_line/example_name_option.feature",
82
83
  "features/command_line/line_number_appended_to_path.feature",
83
84
  "features/command_line/line_number_option.feature",
85
+ "features/configuration/custom_options.feature",
84
86
  "features/configuration/options_file.feature",
85
87
  "features/example_groups/describe_aliases.feature",
86
88
  "features/example_groups/nested_groups.feature",
89
+ "features/filtering/inclusion_filters.feature",
87
90
  "features/formatters/custom_formatter.feature",
88
91
  "features/hooks/around_hook.feature",
89
92
  "features/hooks/before_and_after_hooks.feature",
@@ -124,6 +127,7 @@ Gem::Specification.new do |s|
124
127
  "lib/rspec/core/mocking/with_mocha.rb",
125
128
  "lib/rspec/core/mocking/with_rr.rb",
126
129
  "lib/rspec/core/mocking/with_rspec.rb",
130
+ "lib/rspec/core/object_extensions.rb",
127
131
  "lib/rspec/core/pending.rb",
128
132
  "lib/rspec/core/rake_task.rb",
129
133
  "lib/rspec/core/ruby_project.rb",
@@ -138,6 +142,7 @@ Gem::Specification.new do |s|
138
142
  "spec/autotest/rspec_spec.rb",
139
143
  "spec/rspec/core/configuration_options_spec.rb",
140
144
  "spec/rspec/core/configuration_spec.rb",
145
+ "spec/rspec/core/deprecations_spec.rb",
141
146
  "spec/rspec/core/example_group_spec.rb",
142
147
  "spec/rspec/core/example_spec.rb",
143
148
  "spec/rspec/core/formatters/base_formatter_spec.rb",
@@ -168,7 +173,7 @@ Gem::Specification.new do |s|
168
173
  s.homepage = %q{http://github.com/rspec/core}
169
174
  s.post_install_message = %q{**************************************************
170
175
 
171
- Thank you for installing rspec-core-2.0.0.beta.8
176
+ Thank you for installing rspec-core-2.0.0.beta.9
172
177
 
173
178
  This is beta software. If you are looking
174
179
  for a supported production release, please
@@ -180,12 +185,13 @@ Gem::Specification.new do |s|
180
185
  s.require_paths = ["lib"]
181
186
  s.rubyforge_project = %q{rspec}
182
187
  s.rubygems_version = %q{1.3.6}
183
- s.summary = %q{rspec-core-2.0.0.beta.8}
188
+ s.summary = %q{rspec-core-2.0.0.beta.9}
184
189
  s.test_files = [
185
190
  "spec/autotest/failed_results_re_spec.rb",
186
191
  "spec/autotest/rspec_spec.rb",
187
192
  "spec/rspec/core/configuration_options_spec.rb",
188
193
  "spec/rspec/core/configuration_spec.rb",
194
+ "spec/rspec/core/deprecations_spec.rb",
189
195
  "spec/rspec/core/example_group_spec.rb",
190
196
  "spec/rspec/core/example_spec.rb",
191
197
  "spec/rspec/core/formatters/base_formatter_spec.rb",
@@ -218,19 +224,19 @@ Gem::Specification.new do |s|
218
224
  s.specification_version = 3
219
225
 
220
226
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
221
- s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.8"])
222
- s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.8"])
227
+ s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.9"])
228
+ s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.9"])
223
229
  s.add_development_dependency(%q<cucumber>, [">= 0.5.3"])
224
230
  s.add_development_dependency(%q<autotest>, [">= 4.2.9"])
225
231
  else
226
- s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.8"])
227
- s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.8"])
232
+ s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.9"])
233
+ s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.9"])
228
234
  s.add_dependency(%q<cucumber>, [">= 0.5.3"])
229
235
  s.add_dependency(%q<autotest>, [">= 4.2.9"])
230
236
  end
231
237
  else
232
- s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.8"])
233
- s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.8"])
238
+ s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.9"])
239
+ s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.9"])
234
240
  s.add_dependency(%q<cucumber>, [">= 0.5.3"])
235
241
  s.add_dependency(%q<autotest>, [">= 4.2.9"])
236
242
  end
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe "failed_results_re" do
3
+ describe "failed_results_re for autotest" do
4
4
  it "should match a failure" do
5
5
  re = Autotest::Rspec2.new.failed_results_re
6
6
  re =~ "1)\n'this example' FAILED\nreason\n/path.rb:37:\n\n"
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
  require 'ostruct'
3
3
 
4
- describe Rspec::Core::ConfigurationOptions do
4
+ describe RSpec::Core::ConfigurationOptions do
5
5
 
6
6
  def options_from_args(*args)
7
- Rspec::Core::ConfigurationOptions.new(args).parse_command_line_options
7
+ RSpec::Core::ConfigurationOptions.new(args).parse_command_line_options
8
8
  end
9
9
 
10
10
  describe 'color_enabled' do
@@ -77,6 +77,16 @@ describe Rspec::Core::ConfigurationOptions do
77
77
  options_from_args("dir", "spec/file1_spec.rb", "spec/file2_spec.rb").should include(:files_or_directories_to_run => ["dir", "spec/file1_spec.rb", "spec/file2_spec.rb"])
78
78
  end
79
79
 
80
+ it "provides no files or directories if spec directory does not exist" do
81
+ FileTest.stub(:directory?).with("spec").and_return false
82
+ options_from_args().should include(:files_or_directories_to_run => [])
83
+ end
84
+
85
+ it "parses dir and files from 'spec/file1_spec.rb, spec/file2_spec.rb'" do
86
+ options_from_args("dir", "spec/file1_spec.rb", "spec/file2_spec.rb").should include(:files_or_directories_to_run => ["dir", "spec/file1_spec.rb", "spec/file2_spec.rb"])
87
+
88
+ end
89
+
80
90
  end
81
91
 
82
92
  describe "--backtrace (-b)" do
@@ -100,7 +110,7 @@ describe Rspec::Core::ConfigurationOptions do
100
110
  File.stub(:exist?) { true }
101
111
  File.stub(:readlines) { ["--formatter", "doc"] }
102
112
 
103
- cli_options = Rspec::Core::ConfigurationOptions.new([])
113
+ cli_options = RSpec::Core::ConfigurationOptions.new([])
104
114
  cli_options.apply_to(config)
105
115
  config.formatter.should == 'doc'
106
116
  end
@@ -109,7 +119,7 @@ describe Rspec::Core::ConfigurationOptions do
109
119
  File.stub(:exist?) { true }
110
120
  File.stub(:readlines) { ["--formatter doc"] }
111
121
 
112
- cli_options = Rspec::Core::ConfigurationOptions.new([])
122
+ cli_options = RSpec::Core::ConfigurationOptions.new([])
113
123
  cli_options.apply_to(config)
114
124
  config.formatter.should == 'doc'
115
125
  end
@@ -126,7 +136,7 @@ describe Rspec::Core::ConfigurationOptions do
126
136
  raise "Unexpected path: #{path}"
127
137
  end
128
138
  end
129
- cli_options = Rspec::Core::ConfigurationOptions.new(["--no-color"])
139
+ cli_options = RSpec::Core::ConfigurationOptions.new(["--no-color"])
130
140
 
131
141
  cli_options.apply_to(config)
132
142
 
@@ -147,7 +157,7 @@ describe Rspec::Core::ConfigurationOptions do
147
157
  raise "Unexpected path: #{path}"
148
158
  end
149
159
  end
150
- cli_options = Rspec::Core::ConfigurationOptions.new([])
160
+ cli_options = RSpec::Core::ConfigurationOptions.new([])
151
161
 
152
162
  cli_options.apply_to(config)
153
163
 
@@ -155,7 +165,7 @@ describe Rspec::Core::ConfigurationOptions do
155
165
  end
156
166
 
157
167
  it "prefers CLI options over file options" do
158
- config_options = Rspec::Core::ConfigurationOptions.new(['--formatter', 'progress'])
168
+ config_options = RSpec::Core::ConfigurationOptions.new(['--formatter', 'progress'])
159
169
  config_options.stub(:parse_options_file).and_return(:formatter => 'documentation')
160
170
 
161
171
  config_options.apply_to(config)