mrspec 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Nzc2MWQ3OGJkYjdlMTllYTc0ZjU3MTAwN2Y2OWEwNjM5Y2EzYTg1Mw==
5
- data.tar.gz: !binary |-
6
- YmZhZWIxMWViMzJiODI5NGY2Y2NjM2NjMmFiOTRlYjc4YzI3Mzk5NA==
2
+ SHA1:
3
+ metadata.gz: a085e0174608d4d0a0f6822e1afc3331e06d8897
4
+ data.tar.gz: c4c4123d138a21f535200b981ccb401d36e24ac4
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODRiZmI4MGY4MTQwY2FiZDNhZGE3NWFlMTBkMmU1ZmY1NTBhOWRiODg1NDk3
10
- ODNmY2MyMzBiMmRhZThkNjRlMWRlNjNmZWI2Yjg3MzUxYjllNTdiMzcyZDFk
11
- MDRhMDgzZjdkNjA0NDNjZjljMWRiYTU5MTRiODQ3NDg4ODA1MGI=
12
- data.tar.gz: !binary |-
13
- ZDBkMWI0MTMyNWRkYjFhODI5ZjY3YzkwOTNkNzk0ODlkMDk3ZTE3YTk0NTI3
14
- MmY4ZTNlYTFmMmFlODg5NzcxN2I4ZGYwZWMwNWY0NzZmZTAxNDJhMDViNGMx
15
- MDY3M2JiZDYyYTkxYjJjYzNhZmFkNDVkYzUyZDBiOGU4MGQ1NzE=
6
+ metadata.gz: f40849dee88d1f16650d56a4a1e018f4e6fcd63ae211fec13c32938c22c1383a4c673d89d3c3a1d982876fc19a6fe9a7bf3200990c0bd95314f1ab88dfc37e48
7
+ data.tar.gz: 7f4ff09d289795d013008d28531861a55440cd0e97fd75cd5ba815a292c219a98424223844eb7ca9dbd29c9185461e674a655ff1341edaadbb8a1dcf57f0e77d
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
+ gem 'pry'
data/Readme.md CHANGED
@@ -3,8 +3,6 @@
3
3
  mrspec
4
4
  ======
5
5
 
6
- Minitest and RSpec, sitting in a tree, T. E. S. T. I. N. G!
7
-
8
6
  Runs Minitest tests using RSpec's runner.
9
7
  Also runs RSpec's tests, so if you want to use them side-by-side,
10
8
  this will do it.
@@ -167,9 +165,9 @@ But here are some frustrations I have with it as a test runner:
167
165
  and I am trying to figure out how to configure the test task to do that).
168
166
  The overhead of running additional processes can also be high:
169
167
  think how long Rails takes to start up, now imagine paying that twice every time you want to run your tests!
170
- 1. It makes it difficult to dynamically alter my test invoation.
168
+ 1. It makes it difficult to dynamically alter my test invocation.
171
169
  With Minitest, you can pass `-n test_something` and it will only run the test named `test_something`,
172
- but now I have to edit code tomake that happen.
170
+ but now I have to edit code to make that happen.
173
171
 
174
172
  Furthermore, if someone doesn't know about the test task, or it seems formidable, as it often does to new students
175
173
  (I'm a [teacher](http://turing.io/team)), then they won't use it. They instead run files one at a time.
@@ -589,3 +589,23 @@ Feature: mrspec
589
589
  When I run "mrspec"
590
590
  Then the program ran successfully
591
591
  And stdout includes "I got loaded!"
592
+
593
+ Scenario: Correctly hooks up everything up to enable advanced analysis features
594
+ Given the file "whatev.rb":
595
+ """
596
+ RSpec.describe 'MySpec' do
597
+ it('whatev') do
598
+ @abc = 123
599
+ @abd.even?
600
+ end
601
+ end
602
+
603
+ class MyTest < Minitest::Test
604
+ def test_whatev
605
+ @abc = 123
606
+ @abd.even?
607
+ end
608
+ end
609
+ """
610
+ When I run 'mrspec whatev.rb'
611
+ Then stdout includes "misspell"
@@ -10,6 +10,7 @@ module MRspec
10
10
  filter_gems_from_backtrace 'mrspec', 'minitest'
11
11
  self.pattern = pattern.sub '*_spec.rb', '{*_spec,*_test,test_*}.rb'
12
12
  self.default_formatter = WhatWeveGotHereIsAnErrorToCommunicate::RSpecFormatter
13
+ WhatWeveGotHereIsAnErrorToCommunicate::ExceptionRecorder.record_exception_bindings(self)
13
14
 
14
15
  [Module, TOPLEVEL_BINDING.eval('self').singleton_class].each do |klass|
15
16
  klass.class_eval do
@@ -0,0 +1,54 @@
1
+ module MRspec
2
+ module Describe
3
+
4
+ # They keep changing the bytecode name, eg:
5
+ # ruby 2.1.1
6
+ # 0006 opt_send_simple <callinfo!mid:expect, argc:1, FCALL|ARGS_SKIP>
7
+
8
+ # chruby 2.2.2
9
+ # 0006 opt_send_without_block <callinfo!mid:expect, argc:1, FCALL|ARGS_SIMPLE>
10
+
11
+ # chruby 1.9.3
12
+ # 0005 send :expect, 1, nil, 8, <ic:0>
13
+
14
+ # matches a call to a method that probably comes from minitest, in the disassembled bytecode
15
+ MINITEST_REGEX = /
16
+ ^ # beginning of a line
17
+ \d+ # line number
18
+ \s* # whitespace
19
+ send # bytecode for message send
20
+ \s* #
21
+ :
22
+ (?:
23
+ # Minitest::Assertions#methods
24
+ _synchronize | assert_in_delta | assert_kind_of | assert_output
25
+ assert | assert_in_epsilon | assert_match | assert_predicate
26
+ assert_empty | assert_includes | assert_nil | assert_raises
27
+ assert_equal | assert_instance_of | assert_operator | assert_respond_to
28
+ assert_same | capture_io | flunk | pass
29
+ assert_send | capture_subprocess_io | message | refute
30
+ assert_silent | diff | mu_pp | refute_empty
31
+ assert_throws | exception_details | mu_pp_for_diff | refute_equal
32
+ refute_in_delta | refute_kind_of | refute_predicate | refute_in_epsilon
33
+ refute_match | refute_respond_to | refute_includes | refute_nil
34
+ refute_same | refute_instance_of | refute_operator | skip
35
+
36
+ # Minitest::Test::LifecycleHooks#methods
37
+ after_setup | after_teardown | before_teardown | setup | teardown
38
+
39
+ # Minitest::Spec::DSL::InstanceMethods#methods
40
+ before_setup | expect | value
41
+ )
42
+ ,
43
+ /x
44
+
45
+ def self.guess_which(&block)
46
+ iseq = RubyVM::InstructionSequence.disasm(block)
47
+ if iseq =~ MINITEST_REGEX
48
+ :minitest
49
+ else
50
+ :rspec
51
+ end
52
+ end
53
+ end
54
+ end
@@ -1,3 +1,3 @@
1
1
  module MRspec
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
data/mrspec.gemspec CHANGED
@@ -7,18 +7,18 @@ Gem::Specification.new do |s|
7
7
  s.authors = ["Josh Cheek"]
8
8
  s.email = ["josh.cheek@gmail.com"]
9
9
  s.homepage = "https://github.com/JoshCheek/mrspec"
10
- s.summary = %q{Minitest tests + RSpec's test runner}
10
+ s.summary = %q{Minitest and RSpec, sitting in a tree, T. E. S. T. I. N. G!}
11
11
  s.description = %q{Allows you to run Minitest tests and specs with RSpec's runner, thus you can write both Minitest and RSpec, side-by-side, and take advantage of the many incredibly helpful features it supports (primarily: better formatters, --colour, --fail-fast, and tagging).}
12
12
  s.license = "MIT"
13
13
 
14
- s.files = `git ls-files`.split("\n")
14
+ s.files = `git ls-files`.split("\n") - Dir['mascots/*']
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  s.executables = ['mrspec']
17
17
  s.require_paths = ['lib']
18
18
 
19
19
  s.add_dependency "rspec-core", "~> 3.0"
20
20
  s.add_dependency "minitest", "~> 5.0"
21
- s.add_dependency "what_weve_got_here_is_an_error_to_communicate", "~> 0.0.6"
21
+ s.add_dependency "what_weve_got_here_is_an_error_to_communicate", "~> 0.0.7"
22
22
 
23
23
  s.add_development_dependency "haiti", ">= 0.2.2", "< 0.3"
24
24
  s.add_development_dependency "cucumber", "~> 2.0"
metadata CHANGED
@@ -1,92 +1,92 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Cheek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-17 00:00:00.000000000 Z
11
+ date: 2015-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.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
26
  version: '3.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
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
40
  version: '5.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: what_weve_got_here_is_an_error_to_communicate
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.6
47
+ version: 0.0.7
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.6
54
+ version: 0.0.7
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: haiti
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.2.2
62
- - - <
62
+ - - "<"
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0.3'
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ! '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: 0.2.2
72
- - - <
72
+ - - "<"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0.3'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: cucumber
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '2.0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '2.0'
89
- description: ! 'Allows you to run Minitest tests and specs with RSpec''s runner, thus
89
+ description: 'Allows you to run Minitest tests and specs with RSpec''s runner, thus
90
90
  you can write both Minitest and RSpec, side-by-side, and take advantage of the many
91
91
  incredibly helpful features it supports (primarily: better formatters, --colour,
92
92
  --fail-fast, and tagging).'
@@ -97,9 +97,9 @@ executables:
97
97
  extensions: []
98
98
  extra_rdoc_files: []
99
99
  files:
100
- - .gitignore
101
- - .rspec
102
- - .travis.yml
100
+ - ".gitignore"
101
+ - ".rspec"
102
+ - ".travis.yml"
103
103
  - Gemfile
104
104
  - Readme.md
105
105
  - bin/mrspec
@@ -109,6 +109,7 @@ files:
109
109
  - lib/mrspec/add_options_to_rspec_parser.rb
110
110
  - lib/mrspec/configuration.rb
111
111
  - lib/mrspec/declare_minitests.rb
112
+ - lib/mrspec/describe.rb
112
113
  - lib/mrspec/fix_backtraces_on_minitest_spec.rb
113
114
  - lib/mrspec/minitest_assertion_for_rspec.rb
114
115
  - lib/mrspec/minitest_metadata.rb
@@ -130,20 +131,20 @@ require_paths:
130
131
  - lib
131
132
  required_ruby_version: !ruby/object:Gem::Requirement
132
133
  requirements:
133
- - - ! '>='
134
+ - - ">="
134
135
  - !ruby/object:Gem::Version
135
136
  version: '0'
136
137
  required_rubygems_version: !ruby/object:Gem::Requirement
137
138
  requirements:
138
- - - ! '>='
139
+ - - ">="
139
140
  - !ruby/object:Gem::Version
140
141
  version: '0'
141
142
  requirements: []
142
143
  rubyforge_project:
143
- rubygems_version: 2.4.1
144
+ rubygems_version: 2.4.8
144
145
  signing_key:
145
146
  specification_version: 4
146
- summary: Minitest tests + RSpec's test runner
147
+ summary: Minitest and RSpec, sitting in a tree, T. E. S. T. I. N. G!
147
148
  test_files:
148
149
  - features/mrspec.feature
149
150
  - features/support/env.rb