shoulda-context 2.0.0.rc2 → 2.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
@@ -115,7 +115,12 @@ module Shoulda
115
115
 
116
116
  test_methods[test_unit_class][test_name.to_s] = true
117
117
  file, line_no = should[:block].source_location
118
- context = self
118
+
119
+ # Ruby doesn't know that we are referring to this variable inside of the
120
+ # eval, so it will emit a warning that it's "assigned but unused".
121
+ # However, making a double assignment places `context` on the right hand
122
+ # side of the assignment, thereby putting it into use.
123
+ context = context = self
119
124
 
120
125
  test_unit_class.class_eval <<-end_eval, file, line_no
121
126
  define_method test_name do
@@ -1,5 +1,5 @@
1
1
  module Shoulda
2
2
  module Context
3
- VERSION = "2.0.0.rc2".freeze
3
+ VERSION = "2.0.0.rc3".freeze
4
4
  end
5
5
  end
@@ -23,9 +23,11 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_development_dependency "appraisal"
25
25
  s.add_development_dependency "bundler", "~> 1.0"
26
+ s.add_development_dependency "byebug"
26
27
  s.add_development_dependency "m"
27
28
  s.add_development_dependency "mocha"
28
- s.add_development_dependency "pry-byebug"
29
+ s.add_development_dependency "pry", "~> 0.12.0"
30
+ s.add_development_dependency "pry-byebug", "~> 3.6.0"
29
31
  s.add_development_dependency "rake"
30
32
  s.add_development_dependency "rubocop", "0.64.0"
31
33
  s.add_development_dependency "snowglobe", ">= 0.3.0"
@@ -19,9 +19,16 @@ class RerunSnippetTest < PARENT_TEST_CASE
19
19
 
20
20
  command_runner = app.run_n_unit_test_suite
21
21
 
22
+ expected_file_path_with_line_number =
23
+ if rails_version >= 6
24
+ "rails test test/models/failing_test.rb:5"
25
+ else
26
+ "bin/rails test test/models/failing_test.rb:5"
27
+ end
28
+
22
29
  assert_includes(
23
30
  command_runner.output,
24
- "bin/rails test test/models/failing_test.rb:5"
31
+ expected_file_path_with_line_number
25
32
  )
26
33
  end
27
34
  end
@@ -30,4 +37,9 @@ class RerunSnippetTest < PARENT_TEST_CASE
30
37
  def app
31
38
  @_app ||= RailsApplicationWithShouldaContext.new
32
39
  end
40
+
41
+ def rails_version
42
+ # TODO: Update snowglobe so that we don't have to do this
43
+ app.send(:bundle).version_of("rails")
44
+ end
33
45
  end
@@ -4,6 +4,9 @@ Tests::CurrentBundle.instance.assert_appraisal!
4
4
 
5
5
  #---
6
6
 
7
+ require "pry-byebug"
8
+ require "warnings_logger"
9
+
7
10
  TEST_FRAMEWORK = ENV.fetch("TEST_FRAMEWORK", "minitest")
8
11
 
9
12
  if TEST_FRAMEWORK == "test_unit"
@@ -14,8 +17,6 @@ else
14
17
  require "mocha/minitest"
15
18
  end
16
19
 
17
- require "pry-byebug"
18
-
19
20
  PROJECT_DIR = File.expand_path("../..", __FILE__)
20
21
  PARENT_TEST_CASE =
21
22
  if TEST_FRAMEWORK == "test_unit"
@@ -30,6 +31,13 @@ ASSERTION_CLASS =
30
31
  Minitest::Assertion
31
32
  end
32
33
 
34
+ WarningsLogger::Spy.call(
35
+ project_name: "shoulda-context",
36
+ project_directory: Pathname.new("../..").expand_path(__FILE__)
37
+ )
38
+
39
+ require_relative "support/rails_application_with_shoulda_context"
40
+
33
41
  require_relative "../lib/shoulda/context"
34
42
 
35
43
  Shoulda.autoload_macros(
@@ -37,4 +45,4 @@ Shoulda.autoload_macros(
37
45
  File.join("vendor", "{plugins,gems}", "*")
38
46
  )
39
47
 
40
- require_relative "support/rails_application_with_shoulda_context"
48
+ $VERBOSE = true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoulda-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc2
4
+ version: 2.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot, inc.
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2019-04-21 00:00:00.000000000 Z
16
+ date: 2020-04-05 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: appraisal
@@ -44,7 +44,7 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.0'
46
46
  - !ruby/object:Gem::Dependency
47
- name: m
47
+ name: byebug
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - ">="
@@ -58,7 +58,7 @@ dependencies:
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  - !ruby/object:Gem::Dependency
61
- name: mocha
61
+ name: m
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ">="
@@ -72,7 +72,7 @@ dependencies:
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  - !ruby/object:Gem::Dependency
75
- name: pry-byebug
75
+ name: mocha
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
@@ -85,6 +85,34 @@ dependencies:
85
85
  - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
+ - !ruby/object:Gem::Dependency
89
+ name: pry
90
+ requirement: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: 0.12.0
95
+ type: :development
96
+ prerelease: false
97
+ version_requirements: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: 0.12.0
102
+ - !ruby/object:Gem::Dependency
103
+ name: pry-byebug
104
+ requirement: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: 3.6.0
109
+ type: :development
110
+ prerelease: false
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: 3.6.0
88
116
  - !ruby/object:Gem::Dependency
89
117
  name: rake
90
118
  requirement: !ruby/object:Gem::Requirement
@@ -162,6 +190,8 @@ files:
162
190
  - gemfiles/rails_5_1.gemfile.lock
163
191
  - gemfiles/rails_5_2.gemfile
164
192
  - gemfiles/rails_5_2.gemfile.lock
193
+ - gemfiles/rails_6_0.gemfile
194
+ - gemfiles/rails_6_0.gemfile.lock
165
195
  - lib/shoulda-context.rb
166
196
  - lib/shoulda/context.rb
167
197
  - lib/shoulda/context/assertions.rb
@@ -215,8 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
245
  - !ruby/object:Gem::Version
216
246
  version: 1.3.1
217
247
  requirements: []
218
- rubyforge_project:
219
- rubygems_version: 2.7.9
248
+ rubygems_version: 3.1.2
220
249
  signing_key:
221
250
  specification_version: 4
222
251
  summary: Context framework extracted from Shoulda