minitest-byebug 0.0.1 → 0.0.3

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: cc2380ce4a3bac0c44392580c2ee58cf7e6f9969
4
- data.tar.gz: c7b18cd82187b08a306e98a036f6ae00f067531f
3
+ metadata.gz: 6d6cc070fdfc81bb5b3d2c8af706d3dec36d540c
4
+ data.tar.gz: 49b01b08fc0c1073a26bee848ad3ff6b5152fa76
5
5
  SHA512:
6
- metadata.gz: a2602270680b006c25fe9f35501f3d9950ab36a634bbb57321d2437ae1908e58404d7555f385078bbc484c0122e96851fbd6d3aa2701bac295a2bb5dbd02e3a8
7
- data.tar.gz: b968cfe2f7e3390273a35ccc7a6016bf3b378e953b28bf02d911f3b808e102d94115fd30ae559050750703eae80256c1f6551b514e014525df3d4ecb86eff420
6
+ metadata.gz: c94643afa718e875dadc1f270c64565e0cd4208a91f5390d1642b282eb393761eb112cd766d4854be27489bcaaf657ad644e91099ee3723cd397cf7b811bd1a7
7
+ data.tar.gz: adab5130c5d4d16fa44b2079c8722c4bf1d1700ce1cf361a95eccac2e71e2e91c5cc83ba0e6ee82ecfbeead8f059618df892b1682827aaa6d494a8062fa0c8cb
data/README.md CHANGED
@@ -31,8 +31,9 @@ Then run your tests as normal but define `DEBUG=1`.
31
31
 
32
32
  ## Todo
33
33
 
34
- - [ ] Stop in the failed test. e.g. at an assert call.
35
- - [ ] Stop on errors.
34
+ - Stop in the failed test. e.g. at an assert call.
35
+ - Workaround: when the session starts, `up 3` will take you to the test failure.
36
+ - Stop on errors.
36
37
 
37
38
  ## Credits
38
39
 
@@ -40,6 +41,6 @@ Distributed with an MIT License.
40
41
 
41
42
  Contributions more than welcome.
42
43
 
43
- Made by Kasper Timm Hansen
44
- GitHub: [@kaspth](https://github.com/kaspth)
45
- Twitter: [@kaspth](https://twitter.com/kaspth)
44
+ Made by Kasper Timm Hansen.
45
+ GitHub: [@kaspth](https://github.com/kaspth).
46
+ Twitter: [@kaspth](https://twitter.com/kaspth).
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << "test"
6
+ t.test_files = FileList['test/*test.rb']
7
+ t.verbose = true
8
+ end
data/example.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'minitest/byebug' if ENV["DEBUG"]
1
+ require File.expand_path('lib/minitest/byebug') if ENV["DEBUG"]
2
2
  require 'minitest/autorun'
3
3
 
4
4
  class TestMiniTestUnitTestCase < Minitest::Test
@@ -22,6 +22,11 @@ class TestMiniTestUnitTestCase < Minitest::Test
22
22
  raise "no"
23
23
  end
24
24
 
25
+ def test_skip_does_nothing
26
+ skip "Run tests anyway if ENV['NO_SKIP'] is set"
27
+ raise "HELL"
28
+ end
29
+
25
30
  def test_assert_error
26
31
  assert_equal 42, bad
27
32
  end
@@ -4,7 +4,9 @@ require 'minitest/test'
4
4
 
5
5
  # Start a byebug session when an assertion fails
6
6
  module Minitest::Byebug
7
- VERSION = "0.0.1"
7
+ def skip(msg = nil, bt = caller)
8
+ super unless ENV['NO_SKIP']
9
+ end
8
10
 
9
11
  def assert(test, msg = nil)
10
12
  begin
@@ -1,11 +1,8 @@
1
1
  #encoding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'minitest/byebug'
5
2
 
6
3
  Gem::Specification.new do |spec|
7
4
  spec.name = "minitest-byebug"
8
- spec.version = Minitest::Byebug::VERSION
5
+ spec.version = "0.0.3"
9
6
  spec.authors = ["Kasper Timm Hansen"]
10
7
  spec.email = ["kaspth@gmail.com"]
11
8
  spec.summary = %q{Minitest plugin that starts a byebug session on test failures}
@@ -17,8 +14,8 @@ Gem::Specification.new do |spec|
17
14
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
15
  spec.require_paths = ["lib"]
19
16
 
20
- spec.add_dependency "byebug", "~> 1.8.2"
21
- spec.add_dependency "minitest", "~> 5.0.0"
17
+ spec.add_dependency "byebug"
18
+ spec.add_dependency "minitest", "~> 5.0"
22
19
 
23
20
  spec.add_development_dependency "bundler", "~> 1.3"
24
21
  spec.add_development_dependency "rake"
@@ -0,0 +1,27 @@
1
+ require 'minitest/byebug'
2
+ require 'minitest/autorun'
3
+
4
+ class ByebugTest < Minitest::Test
5
+
6
+ def setup
7
+ ENV['NO_SKIP'] = nil
8
+ end
9
+
10
+ def test_skip_without_debug_set
11
+ assert_raises(Minitest::Skip) do
12
+ skip_helper
13
+ end
14
+ end
15
+
16
+ def test_skip_does_nothing_if_debug_is_set
17
+ ENV['NO_SKIP'] = '1'
18
+ assert_raises(RuntimeError) do
19
+ skip_helper
20
+ end
21
+ end
22
+
23
+ def skip_helper
24
+ skip
25
+ raise RuntimeError
26
+ end
27
+ end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-byebug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Timm Hansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-27 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.2
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.8.2
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 5.0.0
33
+ version: '5.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 5.0.0
40
+ version: '5.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description:
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - Gemfile
78
78
  - LICENSE.txt
79
79
  - README.md
@@ -81,6 +81,7 @@ files:
81
81
  - example.rb
82
82
  - lib/minitest/byebug.rb
83
83
  - minitest-byebug.gemspec
84
+ - test/byebug_test.rb
84
85
  homepage: https://github.com/kaspth/minitest-byebug
85
86
  licenses:
86
87
  - MIT
@@ -91,18 +92,19 @@ require_paths:
91
92
  - lib
92
93
  required_ruby_version: !ruby/object:Gem::Requirement
93
94
  requirements:
94
- - - '>='
95
+ - - ">="
95
96
  - !ruby/object:Gem::Version
96
97
  version: '0'
97
98
  required_rubygems_version: !ruby/object:Gem::Requirement
98
99
  requirements:
99
- - - '>='
100
+ - - ">="
100
101
  - !ruby/object:Gem::Version
101
102
  version: '0'
102
103
  requirements: []
103
104
  rubyforge_project:
104
- rubygems_version: 2.0.3
105
+ rubygems_version: 2.2.2
105
106
  signing_key:
106
107
  specification_version: 4
107
108
  summary: Minitest plugin that starts a byebug session on test failures
108
- test_files: []
109
+ test_files:
110
+ - test/byebug_test.rb