File tree Expand file tree Collapse file tree 3 files changed +10
-22
lines changed Expand file tree Collapse file tree 3 files changed +10
-22
lines changed Original file line number Diff line number Diff line change
1
+ --color
Original file line number Diff line number Diff line change @@ -9,35 +9,13 @@ class Application < ::Rails::Application
9
9
10
10
Dir [ "#{ File . dirname ( __FILE__ ) } /support/**/*.rb" ] . each { |f | require f }
11
11
12
- # TODO - most of this is borrowed from rspec-core's spec_helper - should
13
- # be extracted to something we can use here
14
- def in_editor?
15
- ENV . has_key? ( 'TM_MODE' ) || ENV . has_key? ( 'EMACS' ) || ENV . has_key? ( 'VIM' )
16
- end
17
-
18
12
class RSpec ::Core ::ExampleGroup
19
13
def self . run_all ( reporter = nil )
20
14
run ( reporter || RSpec ::Mocks ::Mock . new ( 'reporter' ) . as_null_object )
21
15
end
22
16
end
23
17
24
- module MatchesForRSpecRailsSpecs
25
- extend RSpec ::Matchers ::DSL
26
-
27
- matcher :be_included_in_files_in do |path |
28
- match do |mod |
29
- stub_metadata (
30
- :example_group => { :file_path => "#{ path } whatever_spec.rb:15" }
31
- )
32
- group = RSpec ::Core ::ExampleGroup . describe
33
- group . included_modules . include? ( mod )
34
- end
35
- end
36
- end
37
-
38
18
RSpec . configure do |c |
39
- c . include MatchesForRSpecRailsSpecs
40
- c . color_enabled = !in_editor?
41
19
c . before ( :each ) do
42
20
@real_world = RSpec . world
43
21
RSpec . instance_variable_set ( :@world , RSpec ::Core ::World . new )
Original file line number Diff line number Diff line change
1
+ RSpec ::Matchers ::define :be_included_in_files_in do |path |
2
+ match do |mod |
3
+ stub_metadata (
4
+ :example_group => { :file_path => "#{ path } whatever_spec.rb:15" }
5
+ )
6
+ group = RSpec ::Core ::ExampleGroup . describe
7
+ group . included_modules . include? ( mod )
8
+ end
9
+ end
You can’t perform that action at this time.
0 commit comments