rspec-console 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rspec-console/runner.rb +20 -17
- data/lib/rspec-console/version.rb +1 -1
- metadata +2 -2
data/lib/rspec-console/runner.rb
CHANGED
@@ -1,27 +1,30 @@
|
|
1
1
|
class RSpecConsole::Runner
|
2
|
-
def self.
|
3
|
-
require '
|
2
|
+
def self.reset(args)
|
3
|
+
require 'rspec'
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
if Gem.loaded_specs['rspec'].version < Gem::Version.new('2.9.10')
|
6
|
+
raise 'Please use RSpec 2.9.10 or later'
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
::RSpec::Core::Runner.disable_autorun!
|
10
|
+
::RSpec::Core::Configuration.class_eval { define_method(:command) { 'rspec' } }
|
11
|
+
::RSpec.reset
|
11
12
|
|
12
|
-
|
13
|
-
::RSpec
|
14
|
-
|
13
|
+
self.config_cache.cache do
|
14
|
+
::RSpec.configure do |config|
|
15
|
+
config.output_stream = STDOUT
|
16
|
+
config.color_enabled = true
|
17
|
+
end
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
config.color_enabled = true
|
20
|
-
end
|
19
|
+
require "./spec/spec_helper"
|
20
|
+
end
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
23
|
+
def self.run(args)
|
24
|
+
require 'rails-env-switcher'
|
24
25
|
|
26
|
+
RailsEnvSwitcher.with_env('test', :reload => true) do
|
27
|
+
reset(args)
|
25
28
|
::RSpec::Core::CommandLine.new(args).run(STDERR, STDOUT)
|
26
29
|
end
|
27
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -51,8 +51,8 @@ extensions: []
|
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
53
|
- lib/rspec-console/config_cache.rb
|
54
|
-
- lib/rspec-console/version.rb
|
55
54
|
- lib/rspec-console/pry.rb
|
55
|
+
- lib/rspec-console/version.rb
|
56
56
|
- lib/rspec-console/runner.rb
|
57
57
|
- lib/rspec-console.rb
|
58
58
|
- README.md
|