rspec-abq 0.2.0 → 0.2.2

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
  SHA256:
3
- metadata.gz: c8b8a25cd22948b9135bd5036dd6668d4d5e676701666d1ec4f292093024b991
4
- data.tar.gz: d7be39b4e9fd99aade6874938a6bd0453b342d3d6e16429095f546eabe4f9a46
3
+ metadata.gz: 2646daec36ed2d6668d9a38082b5072b2fb18f3589f345908945cf5598663df4
4
+ data.tar.gz: b9e8363e86ede1d6b741dd89a912f0f5753ee1549252535e8e28b3e27b427e62
5
5
  SHA512:
6
- metadata.gz: 269ac1413322da658c4f13ffb2dd78fd5f37d08fac32ed8d569e9e5443a131b026d5cd579e5f176ba92b7926fb8b2a34671bd8324d72a0c59b693f86fdc6bac9
7
- data.tar.gz: eef0ac675ec2ba23db3223939bf56a5ac9f978b00604008a6b252b5fe32249e015711f4c60500c760f4e042346bd02740e85101d89d9498640e35e5a79e68391
6
+ metadata.gz: 8aab7ce0826320ac89e1ac83d792b65a4ef6e1db50457540d3475f12ec2302c7bc2523caf1188a085700f430587d4a03458acb7931d8b3a2a4d67150fcf8007d
7
+ data.tar.gz: 5bc79d15380f108891157c6bf1dd21903403fa28a99ecd151f60cedeac64df105a368da0f441a68b431ec37b558aa0b709bf565c9b79806ec5a733ad76d43e6d
data/README.md CHANGED
@@ -16,7 +16,9 @@ end
16
16
 
17
17
  And then execute:
18
18
 
19
- $ bundle
19
+ ```
20
+ bundle
21
+ ```
20
22
 
21
23
  ## Usage
22
24
 
@@ -26,6 +28,10 @@ Use the included binary with abq:
26
28
  abq test -- bundle exec rspec
27
29
  ```
28
30
 
31
+ ## Compatibility
32
+
33
+ This gem is actively tested against rubies 2.6-3.1 and rspecs 3.5-3.12
34
+
29
35
  ## Development
30
36
 
31
37
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -38,7 +44,7 @@ use the release script, `./release_gem.rb`
38
44
 
39
45
  ## Contributing
40
46
 
41
- Bug reports and pull requests are welcome on GitHub at https://github.com/rwx-research/rspec-abq. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
47
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/rwx-research/rspec-abq>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
42
48
 
43
49
  ## Code of Conduct
44
50
 
@@ -36,7 +36,13 @@ module RSpec
36
36
  instance = new(considered_example.inspect_output)
37
37
  set_ivars(instance, before_context_ivars)
38
38
 
39
- all_examples_succeeded &&= Abq.send_test_result_and_advance { |abq_reporter| considered_example.run(instance, abq_reporter) }
39
+ # note: it looks like we can inline the next two lines.
40
+ # DON'T DO IT!
41
+ # true &&= expression : expression will be run, fine!
42
+ # false &&= expression: expression will NOT be run! bad!
43
+ # we want to always run the test, even if the previous test failed.
44
+ result = Abq.send_test_result_and_advance { |abq_reporter| considered_example.run(instance, abq_reporter) }
45
+ all_examples_succeeded &&= result
40
46
 
41
47
  break unless Abq.target_test_case.directly_in_group?(self)
42
48
  end
@@ -53,7 +59,9 @@ module RSpec
53
59
 
54
60
  should_run_context_hooks = descendant_filtered_examples.any?
55
61
  begin
56
- RSpec.current_scope = :before_context_hook
62
+ if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.11.0")
63
+ RSpec.current_scope = :before_context_hook
64
+ end
57
65
  run_before_context_hooks(new("before(:context) hook")) if should_run_context_hooks
58
66
 
59
67
  # If the next example to run is on the surface of this group, scan all
@@ -85,7 +93,9 @@ module RSpec
85
93
  RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met?
86
94
  false
87
95
  ensure
88
- RSpec.current_scope = :after_context_hook
96
+ if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.11.0")
97
+ RSpec.current_scope = :after_context_hook
98
+ end
89
99
  run_after_context_hooks(new("after(:context) hook")) if should_run_context_hooks
90
100
  reporter.example_group_finished(self)
91
101
  end
@@ -4,7 +4,12 @@ module RSpec
4
4
  # and reading the ordering from `init_meta` to set up the current processes settings
5
5
  module Ordering
6
6
  # notably: we don't support custom orderings
7
- SUPPORTED_ORDERINGS = [:defined, :recently_modified, :random]
7
+ SUPPORTED_ORDERINGS =
8
+ if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.11.0")
9
+ [:defined, :recently_modified, :random]
10
+ else
11
+ [:defined, :random]
12
+ end
8
13
 
9
14
  # Raised when we experience an ordering that doesn't exist in SUPPORTED_ORDERINGS
10
15
  UnsupportedOrderingError = Class.new(StandardError)
@@ -1,6 +1,6 @@
1
1
  module RSpec
2
2
  module Abq
3
3
  # current version!
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
6
6
  end
data/lib/rspec/abq.rb CHANGED
@@ -86,9 +86,13 @@ module RSpec
86
86
  if !!ENV[ABQ_GENERATE_MANIFEST] # the abq worker will set this env var if it needs a manifest
87
87
  RSpec::Abq::Manifest.write_manifest(RSpec.world.ordered_example_groups, RSpec.configuration.seed, RSpec.configuration.ordering_registry)
88
88
  # ... Maybe it's fine to just exit(0)
89
- RSpec.world.wants_to_quit = true # ask rspec to exit
90
- RSpec.configuration.error_exit_code = 0 # exit without error
91
- RSpec.world.non_example_failure = true # exit has nothing to do with tests
89
+ if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.10.0")
90
+ RSpec.world.wants_to_quit = true # ask rspec to exit
91
+ RSpec.configuration.error_exit_code = 0
92
+ RSpec.world.non_example_failure = true # exit has nothing to do with tests
93
+ else
94
+ exit(0)
95
+ end
92
96
  return true
93
97
  end
94
98
 
@@ -96,7 +100,12 @@ module RSpec
96
100
  # new rspec process
97
101
 
98
102
  # enabling colors allows us to pass through nicer error messages
99
- RSpec.configuration.color_mode = :on
103
+
104
+ if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.6.0")
105
+ RSpec.configuration.color_mode = :on
106
+ else
107
+ RSpec.configuration.color = true
108
+ end
100
109
 
101
110
  # the first message is the init_meta block of the manifest. This is used to share runtime configuration
102
111
  # information amongst worker processes. In RSpec, it is used to ensure that random ordering between workers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-abq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ayaz Hafiz
@@ -15,16 +15,22 @@ dependencies:
15
15
  name: rspec-core
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.11.0
20
+ version: 3.5.0
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: 3.13.0
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: 3.5.0
31
+ - - "<"
26
32
  - !ruby/object:Gem::Version
27
- version: 3.11.0
33
+ version: 3.13.0
28
34
  description: RSpec::Abq is an rspec plugin that replaces its ordering with one that
29
35
  is controlled by abq. It allows for parallelization of rspec on a single machine
30
36
  or across multiple workers.