rspec_candy 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -169,3 +169,4 @@ If you only care about the matchers or helpers you can also more specifically re
169
169
  - `Object#should_not_receive_and_execute` has been removed (same as `Object#should_not_receive`)
170
170
  - `should_receive_all_with` (over-generic method name for a helper that is rarely useful)
171
171
 
172
+
data/Rakefile CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'rake'
2
- require 'spec/rake/spectask'
3
2
 
4
3
  require "bundler/gem_tasks"
5
4
 
@@ -34,14 +33,4 @@ def for_each_directory_of(path, &block)
34
33
  block.call(directory)
35
34
  end
36
35
  end
37
- #
38
- #
39
- #desc "Run all specs"
40
- #task :all_specs do
41
- # Dir['spec/**/Rakefile'].sort.each do |rakefile|
42
- # directory = File.dirname(rakefile)
43
- # puts '', "\033[44m#{directory}\033[0m", ''
44
- # env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
45
- # system("cd #{directory} && #{env} bundle exec rake")
46
- # end
47
- #end
36
+
@@ -29,7 +29,11 @@ module RSpecCandy
29
29
  end
30
30
 
31
31
  def rspec_root
32
- (defined?(RSpec) ? RSpec : Spec)
32
+ if rspec_version == :rspec1
33
+ Spec
34
+ else
35
+ RSpec
36
+ end
33
37
  end
34
38
 
35
39
  def rspec_matcher_registry
@@ -1,3 +1,3 @@
1
1
  module RSpecCandy
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
data/spec/rspec1/Gemfile CHANGED
@@ -4,8 +4,11 @@ gem 'sqlite3'
4
4
  gem 'rails', '~>2'
5
5
  gem 'rspec', '~>1'
6
6
  gem 'rspec-rails', '~>1'
7
- gem 'ruby-debug'
7
+ gem 'ruby-debug', :platforms => :ruby_18
8
+ gem 'debugger', :platforms => :ruby_19
8
9
  gem 'rspec_candy', :path => '../..'
10
+ gem 'test-unit', '~>1.2', :platforms => :ruby_19
11
+
9
12
 
10
13
  group :state_machine do
11
14
  gem 'state_machine'
@@ -1,21 +1,4 @@
1
- in_memory:
1
+ test:
2
2
  adapter: sqlite3
3
3
  database: ":memory:"
4
4
  verbosity: quiet
5
- sqlite:
6
- adapter: sqlite
7
- dbfile: plugin_test.sqlite.db
8
- sqlite3:
9
- adapter: sqlite3
10
- dbfile: plugin_test.sqlite3.db
11
- postgresql:
12
- adapter: postgresql
13
- username: postgres
14
- password: postgres
15
- database: plugin_test
16
- mysql:
17
- adapter: mysql
18
- host: localhost
19
- username: root
20
- password:
21
- database: plugin_test
@@ -1,10 +1,11 @@
1
1
  $: << File.join(File.dirname(__FILE__), "/../lib" )
2
+ $: << File.dirname(__FILE__)
2
3
 
3
- # Set the default environment to sqlite3's in_memory database
4
- ENV['RAILS_ENV'] ||= 'in_memory'
4
+ ENV['RAILS_ENV'] = 'test'
5
+ ENV['RAILS_ROOT'] = 'app_root'
5
6
 
6
7
  # Load the Rails environment and testing framework
7
- require "#{File.dirname(__FILE__)}/app_root/config/environment"
8
+ require "#{File.dirname(__FILE__)}/../app_root/config/environment"
8
9
  require 'spec/rails'
9
10
 
10
11
  # Load dependencies
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ # Some gems that are actually compatible with RSpec 1 define RSpec,
4
+ # so make sure we don't detect on that.
5
+ module ::RSpec
6
+ end
7
+
8
+ describe RSpecCandy::Switcher do
9
+
10
+ describe "#rspec_version" do
11
+
12
+ it "should detect rspec1" do
13
+ RSpecCandy::Switcher.rspec_version.should == :rspec1
14
+ end
15
+
16
+ end
17
+
18
+ describe '#rspec_root' do
19
+
20
+ it 'should return the Spec module' do
21
+ RSpecCandy::Switcher.rspec_root.should == Spec
22
+ end
23
+
24
+ end
25
+
26
+ end
data/spec/rspec2/Gemfile CHANGED
@@ -4,10 +4,10 @@ gem 'sqlite3'
4
4
  gem 'rails', '~>3'
5
5
  gem 'rspec', '~>2'
6
6
  gem 'rspec-rails', '~>2'
7
- gem 'ruby-debug'
7
+ gem 'ruby-debug', :platforms => :ruby_18
8
+ gem 'debugger', :platforms => :ruby_19
8
9
  gem 'rspec_candy', :path => '../..'
9
10
 
10
-
11
11
  group :state_machine do
12
12
  gem 'state_machine'
13
13
  end
@@ -1,21 +1,4 @@
1
- in_memory:
1
+ test:
2
2
  adapter: sqlite3
3
3
  database: ":memory:"
4
4
  verbosity: quiet
5
- sqlite:
6
- adapter: sqlite
7
- dbfile: plugin_test.sqlite.db
8
- sqlite3:
9
- adapter: sqlite3
10
- dbfile: plugin_test.sqlite3.db
11
- postgresql:
12
- adapter: postgresql
13
- username: postgres
14
- password: postgres
15
- database: plugin_test
16
- mysql:
17
- adapter: mysql
18
- host: localhost
19
- username: root
20
- password:
21
- database: plugin_test
@@ -1,35 +0,0 @@
1
- HasDefaultSpecApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Log error messages when you accidentally call methods on nil.
11
- config.whiny_nils = true
12
-
13
- # Show full error reports and disable caching
14
- config.consider_all_requests_local = true
15
- config.action_controller.perform_caching = false
16
-
17
- # Raise exceptions instead of rendering exception templates
18
- config.action_dispatch.show_exceptions = false
19
-
20
- # Disable request forgery protection in test environment
21
- config.action_controller.allow_forgery_protection = false
22
-
23
- # Tell Action Mailer not to deliver emails to the real world.
24
- # The :test delivery method accumulates sent emails in the
25
- # ActionMailer::Base.deliveries array.
26
- config.action_mailer.delivery_method = :test
27
-
28
- # Use SQL instead of Active Record's schema dumper when creating the test database.
29
- # This is necessary if your schema can't be completely dumped by the schema dumper,
30
- # like if you have constraints or database-specific column types
31
- # config.active_record.schema_format = :sql
32
-
33
- # Print deprecation notices to the stderr
34
- config.active_support.deprecation = :stderr
35
- end
@@ -1,11 +1,10 @@
1
1
  $: << File.join(File.dirname(__FILE__), "/../lib" )
2
2
 
3
- # Set the default environment to sqlite3's in_memory database
4
- ENV['RAILS_ENV'] ||= 'in_memory'
3
+ ENV['RAILS_ENV'] = 'test'
5
4
  ENV['RAILS_ROOT'] = 'app_root'
6
5
 
7
6
  # Load the Rails environment and testing framework
8
- require "#{File.dirname(__FILE__)}/app_root/config/environment"
7
+ require "#{File.dirname(__FILE__)}/../app_root/config/environment"
9
8
  require 'rspec/rails'
10
9
 
11
10
  # Load dependencies
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe RSpecCandy::Switcher do
4
+
5
+ describe "#rspec_version" do
6
+
7
+ it "should detect rspec2" do
8
+ RSpecCandy::Switcher.rspec_version.should == :rspec2
9
+ end
10
+
11
+ end
12
+
13
+ describe '#rspec_root' do
14
+
15
+ it 'should return the RSpec module' do
16
+ RSpecCandy::Switcher.rspec_root.should == RSpec
17
+ end
18
+
19
+ end
20
+
21
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_candy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch
@@ -73,18 +73,14 @@ files:
73
73
  - spec/rspec1/app_root/config/boot.rb
74
74
  - spec/rspec1/app_root/config/database.yml
75
75
  - spec/rspec1/app_root/config/environment.rb
76
- - spec/rspec1/app_root/config/environments/in_memory.rb
77
- - spec/rspec1/app_root/config/environments/mysql.rb
78
- - spec/rspec1/app_root/config/environments/postgresql.rb
79
- - spec/rspec1/app_root/config/environments/sqlite.rb
80
- - spec/rspec1/app_root/config/environments/sqlite3.rb
76
+ - spec/rspec1/app_root/config/environments/test.rb
81
77
  - spec/rspec1/app_root/config/initializers/state_machine.rb
82
78
  - spec/rspec1/app_root/config/routes.rb
83
79
  - spec/rspec1/app_root/log/.gitignore
84
80
  - spec/rspec1/rcov.opts
85
81
  - spec/rspec1/spec.opts
86
- - spec/rspec1/spec_helper.rb
87
- - spec/rspec1/switcher_spec.rb
82
+ - spec/rspec1/spec/spec_helper.rb
83
+ - spec/rspec1/spec/switcher_spec.rb
88
84
  - spec/rspec2/.rspec
89
85
  - spec/rspec2/Gemfile
90
86
  - spec/rspec2/Rakefile
@@ -93,11 +89,6 @@ files:
93
89
  - spec/rspec2/app_root/config/boot.rb
94
90
  - spec/rspec2/app_root/config/database.yml
95
91
  - spec/rspec2/app_root/config/environment.rb
96
- - spec/rspec2/app_root/config/environments/in_memory.rb
97
- - spec/rspec2/app_root/config/environments/mysql.rb
98
- - spec/rspec2/app_root/config/environments/postgresql.rb
99
- - spec/rspec2/app_root/config/environments/sqlite.rb
100
- - spec/rspec2/app_root/config/environments/sqlite3.rb
101
92
  - spec/rspec2/app_root/config/environments/test.rb
102
93
  - spec/rspec2/app_root/config/initializers/backtrace_silencers.rb
103
94
  - spec/rspec2/app_root/config/initializers/inflections.rb
@@ -109,7 +100,8 @@ files:
109
100
  - spec/rspec2/app_root/config/routes.rb
110
101
  - spec/rspec2/app_root/log/.gitkeep
111
102
  - spec/rspec2/rcov.opts
112
- - spec/rspec2/spec_helper.rb
103
+ - spec/rspec2/spec/spec_helper.rb
104
+ - spec/rspec2/spec/switcher_spec.rb
113
105
  - spec/shared/app_root/app/controllers/application_controller.rb
114
106
  - spec/shared/app_root/app/models/model.rb
115
107
  - spec/shared/app_root/app/models/state_machine_model.rb
File without changes
File without changes
File without changes
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe RSpecCandy::Switcher do
4
- describe "#rspec_version" do
5
- it "detects rspec1" do
6
- RSpecCandy::Switcher.rspec_version.should == :rspec1
7
- end
8
-
9
- it "detects rspec1 when RSpec is defined" do
10
- module ::RSpec
11
- end
12
- RSpecCandy::Switcher.rspec_version.should == :rspec1
13
- end
14
- end
15
- end
File without changes
File without changes
File without changes