rspec-console 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,27 +1,30 @@
1
1
  class RSpecConsole::Runner
2
- def self.run(args)
3
- require 'rails-env-switcher'
2
+ def self.reset(args)
3
+ require 'rspec'
4
4
 
5
- RailsEnvSwitcher.with_env('test', :reload => true) do
6
- require 'rspec'
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
- if Gem.loaded_specs['rspec'].version < Gem::Version.new('2.9.10')
9
- raise 'Please use RSpec 2.9.10 or later'
10
- end
9
+ ::RSpec::Core::Runner.disable_autorun!
10
+ ::RSpec::Core::Configuration.class_eval { define_method(:command) { 'rspec' } }
11
+ ::RSpec.reset
11
12
 
12
- ::RSpec::Core::Runner.disable_autorun!
13
- ::RSpec::Core::Configuration.class_eval { define_method(:command) { 'rspec' } }
14
- ::RSpec.reset
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
- self.config_cache.cache do
17
- ::RSpec.configure do |config|
18
- config.output_stream = STDOUT
19
- config.color_enabled = true
20
- end
19
+ require "./spec/spec_helper"
20
+ end
21
+ end
21
22
 
22
- require "./spec/spec_helper"
23
- end
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
@@ -1,3 +1,3 @@
1
1
  module RSpecConsole
2
- VERSION = '0.1'
2
+ VERSION = '0.2'
3
3
  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.1'
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