multi_test 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9db6c2643d6411415374ed6c059a8d22b8195e13
4
- data.tar.gz: 6abf78c5171584dcc360ef9b612eeebf404dc563
3
+ metadata.gz: d0afef8f6d5935c731cc77f5ce62112900f7f267
4
+ data.tar.gz: 01f9568a08b9855e9cf1c90ef72a2f17a39d54a3
5
5
  SHA512:
6
- metadata.gz: aa888feea42b5d09e01d5f2a96c23d5cb0591ce5182a0645743ba3a353faa401f4291d42a10a640f115e4d23a9ec5ab5c80d4e5aaab628e0233504d26c221499
7
- data.tar.gz: 8dd46562d8dfe258f0c043af2f496214730122568f699dc6d7b5fdede21e7691837932825a7f678f31704ca1ae9b1263e7cfe9efc6fd2d03ee7bcf07d5acd8a0
6
+ metadata.gz: afbb8a2df72e7fa5804ed0da863d674aa3cfb86fd63c3d4f69fea55034ee79aa8ad17c3aede614d13063585cc3d75c9eefbd44c9b3b23263ff15fc1b3b0a8417
7
+ data.tar.gz: c2c59790170b596573f972cd5175104d31bbc134cfc9ae92933feeec2c35db9d837455b04f763c1ec365b428bb5e0066620784a4bff72fe7059f3ca482619306
@@ -2,6 +2,7 @@ rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
4
  - 2.1.0
5
+ - jruby
5
6
  script: make
6
7
  before_install:
7
8
  gem install bundler -v 1.5.1
data/History.md CHANGED
@@ -1,3 +1,7 @@
1
1
  ## [v0.0.3](https://github.com/cucumber/multi_test/compare/v0.0.2...v0.0.3)
2
2
 
3
- * Fix for Rails 4.1, Minitest 5.x ([#4](https://github.com/cucumber/multi_test/pull/4) Andy Lindeman
3
+ * Fix for Rails 4.1, Minitest 5.x ([#4](https://github.com/cucumber/multi_test/pull/4) Andy Lindeman)
4
+
5
+ ## [v0.0.2](https://github.com/cucumber/multi_test/compare/bae4b700eb63cfb4e95f7acc35e25683f697905a...v0.0.2)
6
+
7
+ * First gem release
data/Makefile CHANGED
File without changes
data/README.md CHANGED
File without changes
@@ -1,3 +1,4 @@
1
+ require 'multi_test/assertion_library'
1
2
  module MultiTest
2
3
  def self.disable_autorun
3
4
  if defined?(Test::Unit::Runner)
@@ -25,4 +26,8 @@ module MultiTest
25
26
  end
26
27
  end
27
28
  end
29
+
30
+ def self.extend_with_best_assertion_library(object)
31
+ AssertionLibrary.detect_best.extend_world(object)
32
+ end
28
33
  end
@@ -0,0 +1,63 @@
1
+ require 'multi_test/minitest_world'
2
+
3
+ module MultiTest
4
+ class AssertionLibrary
5
+ def self.detect_best
6
+ available.detect(&:require?)
7
+ end
8
+
9
+ def initialize(requirer, extender)
10
+ @requirer = requirer
11
+ @extender = extender
12
+ end
13
+
14
+ def require?
15
+ begin
16
+ @requirer.call
17
+ true
18
+ rescue LoadError
19
+ false
20
+ end
21
+ end
22
+
23
+ def extend_world(world)
24
+ @extender.call(world)
25
+ end
26
+
27
+ private
28
+
29
+ def self.available
30
+ @available ||= [
31
+ AssertionLibrary.new(
32
+ proc { require 'rspec/expectations' },
33
+ proc { |object| object.extend(::RSpec::Matchers) },
34
+ ),
35
+ AssertionLibrary.new(
36
+ proc {
37
+ require 'spec/expectations'
38
+ require 'spec/runner/differs/default'
39
+ require 'ostruct'
40
+ },
41
+ proc { |object|
42
+ options = OpenStruct.new(:diff_format => :unified, :context_lines => 3)
43
+ Spec::Expectations.differ = Spec::Expectations::Differs::Default.new(options)
44
+ object.extend(Spec::Matchers)
45
+ },
46
+ ),
47
+ AssertionLibrary.new(
48
+ proc { require 'minitest/assertions' },
49
+ proc { |object| object.extend(MinitestWorld) },
50
+ ),
51
+ AssertionLibrary.new(
52
+ proc { require 'minitest/unit' },
53
+ proc { |object| object.extend(MiniTest::Assertions) },
54
+ ),
55
+ AssertionLibrary.new(
56
+ proc { require 'test/unit/assertions' },
57
+ proc { |object| object.extend(Test::Unit::Assertions) },
58
+ ),
59
+ ]
60
+ end
61
+ end
62
+ end
63
+
@@ -0,0 +1,10 @@
1
+ module MultiTest
2
+ module MinitestWorld
3
+ def self.extended(base)
4
+ base.extend(Minitest::Assertions)
5
+ base.assertions = 0
6
+ end
7
+
8
+ attr_accessor :assertions
9
+ end
10
+ end
@@ -1,10 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
3
- require "cucumber/platform"
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
  s.name = 'multi_test'
7
- s.version = '0.0.3'
6
+ s.version = '0.1.0'
8
7
  s.authors = ["Matt Wynne", "Steve Tooke"]
9
8
  s.description = 'Wafter-thin gem to help control rogue test/unit/autorun requires'
10
9
  s.summary = "multi-test-#{s.version}"
@@ -1,2 +1,3 @@
1
1
  require_activesupport_testing_autorun.rb
2
+ minitest_assertions.rb
2
3
 
@@ -1,2 +1,2 @@
1
1
  require_activesupport_testing_autorun.rb
2
-
2
+ minitest_assertions.rb
@@ -1,3 +1,3 @@
1
1
  bundler_require.rb
2
2
  minitest_propagate_exit_code.rb
3
-
3
+ minitest_assertions.rb
@@ -1,3 +1,3 @@
1
1
  bundler_require.rb
2
2
  minitest_propagate_exit_code.rb
3
-
3
+ minitest_assertions.rb
@@ -1,3 +1,3 @@
1
1
  bundler_require.rb
2
2
  minitest_propagate_exit_code.rb
3
-
3
+ minitest_assertions.rb
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rspec", "1.3.2"
4
+ gem "diff-lcs"
@@ -0,0 +1,12 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.2.5)
5
+ rspec (1.3.2)
6
+
7
+ PLATFORMS
8
+ ruby
9
+
10
+ DEPENDENCIES
11
+ diff-lcs
12
+ rspec (= 1.3.2)
@@ -0,0 +1,3 @@
1
+ bundler_require.rb
2
+ spec_matchers.rb
3
+
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rspec", "~> 2.14"
@@ -0,0 +1,18 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.2.5)
5
+ rspec (2.14.1)
6
+ rspec-core (~> 2.14.0)
7
+ rspec-expectations (~> 2.14.0)
8
+ rspec-mocks (~> 2.14.0)
9
+ rspec-core (2.14.8)
10
+ rspec-expectations (2.14.5)
11
+ diff-lcs (>= 1.1.3, < 2.0)
12
+ rspec-mocks (2.14.6)
13
+
14
+ PLATFORMS
15
+ ruby
16
+
17
+ DEPENDENCIES
18
+ rspec (~> 2.14)
@@ -0,0 +1,3 @@
1
+ bundler_require.rb
2
+ rspec_matchers.rb
3
+
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rspec', '~> 3.0.0.beta'
@@ -0,0 +1,22 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.2.5)
5
+ rspec (3.0.0.beta2)
6
+ rspec-core (= 3.0.0.beta2)
7
+ rspec-expectations (= 3.0.0.beta2)
8
+ rspec-mocks (= 3.0.0.beta2)
9
+ rspec-core (3.0.0.beta2)
10
+ rspec-support (= 3.0.0.beta2)
11
+ rspec-expectations (3.0.0.beta2)
12
+ diff-lcs (>= 1.2.0, < 2.0)
13
+ rspec-support (= 3.0.0.beta2)
14
+ rspec-mocks (3.0.0.beta2)
15
+ rspec-support (= 3.0.0.beta2)
16
+ rspec-support (3.0.0.beta2)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ rspec (~> 3.0.0.beta)
@@ -0,0 +1,3 @@
1
+ bundler_require.rb
2
+ rspec_matchers.rb
3
+
@@ -1,3 +1,3 @@
1
1
  bundler_require.rb
2
2
  require_test_unit.rb
3
-
3
+ test_unit_assertions.rb
@@ -1,3 +1,3 @@
1
1
  bundler_require.rb
2
2
  require_test_unit.rb
3
-
3
+ test_unit_assertions.rb
@@ -0,0 +1,7 @@
1
+ require "multi_test"
2
+
3
+ # Now we create the world
4
+ MultiTest.extend_with_best_assertion_library(self)
5
+
6
+ # Now we execute a scenario and assert something
7
+ assert_equal(1,1)
@@ -4,4 +4,3 @@ require 'test/unit'
4
4
  # Now cucumber loads
5
5
  require "multi_test"
6
6
  MultiTest.disable_autorun
7
-
@@ -0,0 +1,7 @@
1
+ require 'multi_test'
2
+ # Now we create the world
3
+ MultiTest.extend_with_best_assertion_library(self)
4
+
5
+ # Now we execute a scenario and assert something
6
+ expect(1).to eq(1)
7
+
@@ -0,0 +1,7 @@
1
+ require "multi_test"
2
+
3
+ # Now we create the world
4
+ MultiTest.extend_with_best_assertion_library(self)
5
+
6
+ # Now we execute a scenario and assert something
7
+ 1.should == 1
@@ -0,0 +1,6 @@
1
+ require "multi_test"
2
+ # Now we create the world
3
+ MultiTest.extend_with_best_assertion_library(self)
4
+
5
+ # Now we execute a scenario and assert something
6
+ assert_equal(1,1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wynne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-01 00:00:00.000000000 Z
12
+ date: 2014-03-16 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Wafter-thin gem to help control rogue test/unit/autorun requires
15
15
  email: cukes@googlegroups.com
@@ -17,13 +17,15 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - .travis.yml
20
+ - ".travis.yml"
21
21
  - History.md
22
22
  - LICENSE
23
23
  - Makefile
24
24
  - README.md
25
25
  - Rakefile
26
26
  - lib/multi_test.rb
27
+ - lib/multi_test/assertion_library.rb
28
+ - lib/multi_test/minitest_world.rb
27
29
  - multi_test.gemspec
28
30
  - test/README.md
29
31
  - test/all
@@ -45,6 +47,15 @@ files:
45
47
  - test/gemfiles/plain-ruby/Gemfile
46
48
  - test/gemfiles/plain-ruby/Gemfile.lock
47
49
  - test/gemfiles/plain-ruby/scenarios
50
+ - test/gemfiles/rspec-1.3.2/Gemfile
51
+ - test/gemfiles/rspec-1.3.2/Gemfile.lock
52
+ - test/gemfiles/rspec-1.3.2/scenarios
53
+ - test/gemfiles/rspec-2.14/Gemfile
54
+ - test/gemfiles/rspec-2.14/Gemfile.lock
55
+ - test/gemfiles/rspec-2.14/scenarios
56
+ - test/gemfiles/rspec-3.0/Gemfile
57
+ - test/gemfiles/rspec-3.0/Gemfile.lock
58
+ - test/gemfiles/rspec-3.0/scenarios
48
59
  - test/gemfiles/test-unit-2.4.8/Gemfile
49
60
  - test/gemfiles/test-unit-2.4.8/Gemfile.lock
50
61
  - test/gemfiles/test-unit-2.4.8/scenarios
@@ -53,34 +64,38 @@ files:
53
64
  - test/gemfiles/test-unit-2.4.9/scenarios
54
65
  - test/run
55
66
  - test/scenarios/bundler_require.rb
67
+ - test/scenarios/minitest_assertions.rb
56
68
  - test/scenarios/minitest_propagate_exit_code.rb
57
69
  - test/scenarios/require_activesupport_testing_autorun.rb
58
70
  - test/scenarios/require_test_unit.rb
71
+ - test/scenarios/rspec_matchers.rb
72
+ - test/scenarios/spec_matchers.rb
73
+ - test/scenarios/test_unit_assertions.rb
59
74
  homepage: http://cukes.info
60
75
  licenses:
61
76
  - MIT
62
77
  metadata: {}
63
78
  post_install_message:
64
79
  rdoc_options:
65
- - --charset=UTF-8
80
+ - "--charset=UTF-8"
66
81
  require_paths:
67
82
  - lib
68
83
  required_ruby_version: !ruby/object:Gem::Requirement
69
84
  requirements:
70
- - - '>='
85
+ - - ">="
71
86
  - !ruby/object:Gem::Version
72
87
  version: '0'
73
88
  required_rubygems_version: !ruby/object:Gem::Requirement
74
89
  requirements:
75
- - - '>='
90
+ - - ">="
76
91
  - !ruby/object:Gem::Version
77
92
  version: '0'
78
93
  requirements: []
79
94
  rubyforge_project:
80
- rubygems_version: 2.1.5
95
+ rubygems_version: 2.2.0
81
96
  signing_key:
82
97
  specification_version: 4
83
- summary: multi-test-0.0.3
98
+ summary: multi-test-0.1.0
84
99
  test_files:
85
100
  - test/README.md
86
101
  - test/all
@@ -102,6 +117,15 @@ test_files:
102
117
  - test/gemfiles/plain-ruby/Gemfile
103
118
  - test/gemfiles/plain-ruby/Gemfile.lock
104
119
  - test/gemfiles/plain-ruby/scenarios
120
+ - test/gemfiles/rspec-1.3.2/Gemfile
121
+ - test/gemfiles/rspec-1.3.2/Gemfile.lock
122
+ - test/gemfiles/rspec-1.3.2/scenarios
123
+ - test/gemfiles/rspec-2.14/Gemfile
124
+ - test/gemfiles/rspec-2.14/Gemfile.lock
125
+ - test/gemfiles/rspec-2.14/scenarios
126
+ - test/gemfiles/rspec-3.0/Gemfile
127
+ - test/gemfiles/rspec-3.0/Gemfile.lock
128
+ - test/gemfiles/rspec-3.0/scenarios
105
129
  - test/gemfiles/test-unit-2.4.8/Gemfile
106
130
  - test/gemfiles/test-unit-2.4.8/Gemfile.lock
107
131
  - test/gemfiles/test-unit-2.4.8/scenarios
@@ -110,7 +134,11 @@ test_files:
110
134
  - test/gemfiles/test-unit-2.4.9/scenarios
111
135
  - test/run
112
136
  - test/scenarios/bundler_require.rb
137
+ - test/scenarios/minitest_assertions.rb
113
138
  - test/scenarios/minitest_propagate_exit_code.rb
114
139
  - test/scenarios/require_activesupport_testing_autorun.rb
115
140
  - test/scenarios/require_test_unit.rb
141
+ - test/scenarios/rspec_matchers.rb
142
+ - test/scenarios/spec_matchers.rb
143
+ - test/scenarios/test_unit_assertions.rb
116
144
  has_rdoc: