rspec_candy 0.2.1 → 0.2.2

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/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.3"
5
+ - ree
6
+ script: rake all:bundle all:spec
7
+ notifications:
8
+ email:
9
+ - fail@makandra.de
10
+ branches:
11
+ only:
12
+ - master
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- #rspec_candy
2
-
1
+ rspec_candy [![Build Status](https://secure.travis-ci.org/makandra/rspec_candy.png?branch=master)](https://travis-ci.org/makandra/rspec_candy)
2
+ ==========================================
3
3
 
4
4
  A collection of nifty helpers and matchers for your RSpec suite.
5
5
 
data/Rakefile CHANGED
@@ -3,16 +3,45 @@ require 'spec/rake/spectask'
3
3
 
4
4
  require "bundler/gem_tasks"
5
5
 
6
-
7
6
  desc 'Default: Run all specs.'
8
- task :default => :all_specs
7
+ task :default => 'all:spec'
8
+
9
+ namespace :all do
10
+
11
+ desc "Run specs on all spec apps"
12
+ task :spec do
13
+ success = true
14
+ for_each_directory_of('spec/**/Rakefile') do |directory|
15
+ env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
16
+ success &= system("cd #{directory} && #{env} bundle exec rake spec")
17
+ end
18
+ fail "Tests failed" unless success
19
+ end
20
+
21
+ desc "Bundle all spec apps"
22
+ task :bundle do
23
+ for_each_directory_of('spec/**/Gemfile') do |directory|
24
+ system("cd #{directory} && rm -f Gemfile.lock && bundle install")
25
+ end
26
+ end
27
+
28
+ end
9
29
 
10
- desc "Run all specs"
11
- task :all_specs do
12
- Dir['spec/**/Rakefile'].sort.each do |rakefile|
30
+ def for_each_directory_of(path, &block)
31
+ Dir[path].sort.each do |rakefile|
13
32
  directory = File.dirname(rakefile)
14
33
  puts '', "\033[44m#{directory}\033[0m", ''
15
- env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
16
- system("cd #{directory} && #{env} bundle exec rake")
34
+ block.call(directory)
17
35
  end
18
36
  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
@@ -3,7 +3,7 @@ module RSpecCandy
3
3
  extend self
4
4
 
5
5
  def rspec_version
6
- if defined?(RSpec)
6
+ if defined?(RSpec::Core)
7
7
  :rspec2
8
8
  elsif defined?(Spec)
9
9
  :rspec1
@@ -1,3 +1,3 @@
1
1
  module RSpecCandy
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -0,0 +1,15 @@
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
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: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-11-23 00:00:00 +01:00
19
+ date: 2013-02-15 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -43,6 +43,7 @@ extra_rdoc_files: []
43
43
 
44
44
  files:
45
45
  - .gitignore
46
+ - .travis.yml
46
47
  - README.md
47
48
  - Rakefile
48
49
  - lib/rspec_candy.rb
@@ -83,6 +84,7 @@ files:
83
84
  - spec/rspec1/rcov.opts
84
85
  - spec/rspec1/spec.opts
85
86
  - spec/rspec1/spec_helper.rb
87
+ - spec/rspec1/switcher_spec.rb
86
88
  - spec/rspec2/.rspec
87
89
  - spec/rspec2/Gemfile
88
90
  - spec/rspec2/Rakefile