hypertest 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +42 -28
  3. data/hypertest.gemspec +1 -1
  4. data/lib/hypertest.rb +10 -2
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e55e87ee52f10eb7e5ff86354124cd305239f3a95bc40e2a6d264957e65a1872
4
- data.tar.gz: 5e12c783c60363473716ef99ac366c1c122fb07b4e4bd3967dc40175e7793ce7
3
+ metadata.gz: 6930c06ce78711116889215c13cc2937d6832efb7e0cd72175151695d7c2beb1
4
+ data.tar.gz: '090b6239a6837ac9e8d4269346b930c6b786abe97fd2035e7b02be9c4602770d'
5
5
  SHA512:
6
- metadata.gz: 0b1955115622af7ad0fa6e4aae5633b22790b26911395c607c87b1c75bc994c054cdcc75501a30880f273bb1291d4235f0e42a9f97a234a65937460ff12e97d5
7
- data.tar.gz: 04d45210a85e6ea5530766643480893c73c265a1d0029b6e0250c0be703afb8810d212c9ae46682670bc18978b7a32e955d68bddc030a044b1da351fc8a14b23
6
+ metadata.gz: e4d1cd1b6bc3747c5dcf017c5aba98ff05adebf93781ce54df4d094f3f1536b9e0357c679f0d90adf6c01bc2453dccc106e7f1a09551d3deec52b812e2b752f5
7
+ data.tar.gz: 1f355af1a5aa0b4b9698e18d833a240cdba49a1e6d84e1c63e70b7328a88ad8a702bef0106a53780fda542e8f151baccea7bade8a9034eadd5a3ba185cf20e3c
data/README.md CHANGED
@@ -1,39 +1,53 @@
1
1
  # Hypertest
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/hypertest`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Hypertest is a very simple tool to help you run fast test suites in a very tight
4
+ dev loop on file changes.
6
5
 
7
6
  ## Installation
8
7
 
9
- Add this line to your application's Gemfile:
8
+ Add `gem 'hypertest'` to your Gemfile, maybe in a `:development, :test` group,
9
+ then `bundle install`. `gem 'bootsnap'` is also recommended.
10
+
11
+ Generally you will want to use Hypertest by creating a file like:
10
12
 
11
13
  ```ruby
12
- gem 'hypertest'
14
+ #!/usr/bin/env ruby
15
+ # bin/hypertest
16
+
17
+ require 'bundler/setup'
18
+ Bundler.require(:development, :test)
19
+
20
+ ROOT = File.expand_path('..', __dir__)
21
+ $LOAD_PATH.unshift(File.join(ROOT, 'lib'))
22
+ $LOAD_PATH.unshift(File.join(ROOT, 'test'))
23
+
24
+ # Bootsnap isn't necessary but generally speeds things up even further.
25
+ Bootsnap.setup(
26
+ cache_dir: "#{ROOT}/tmp/cache",
27
+ ignore_directories: [],
28
+ development_mode: true,
29
+ load_path_cache: true,
30
+ compile_cache_iseq: true,
31
+ compile_cache_yaml: true,
32
+ compile_cache_json: true,
33
+ readonly: false,
34
+ )
35
+
36
+ Hypertest.run do
37
+ require 'test_helper'
38
+ Dir.glob('test/**/*_test.rb').each do |file|
39
+ require File.join(ROOT, file)
40
+ end
41
+ end
13
42
  ```
14
43
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install hypertest
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/burke/hypertest.
44
+ This loads ruby and your bundle, then forks to load your test helper and tests
45
+ after each file change. Happy hacking!
36
46
 
37
- ## License
47
+ ## Limitations
38
48
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
49
+ * Only works on macOS because I've only implemented this with FSEvents. Patches
50
+ welcome.
51
+ * Path filtering (`ignore:`) can only match on directory paths because the
52
+ FSEvents library doesn't seem to want to let me use `file_events: true`.
53
+ *
data/hypertest.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "hypertest"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["Burke Libbey"]
9
9
  spec.email = ["burke.libbey@shopify.com"]
10
10
 
data/lib/hypertest.rb CHANGED
@@ -46,10 +46,18 @@ module Hypertest
46
46
  def print_result(t1, t2, stat)
47
47
  ms = ((t2 - t1) * 1000).round
48
48
  if stat.success?
49
- STDERR.puts "\x1b[1;34m%% Completed in #{ms}ms\x1b[0m"
49
+ info("Completed in #{ms}ms")
50
50
  else
51
- STDERR.puts "\x1b[1;31m%% Failed in #{ms}ms\x1b[0m"
51
+ err("Failed in #{ms}ms")
52
52
  end
53
53
  end
54
+
55
+ def info(msg)
56
+ STDERR.puts("\x1b[1;34m%% #{msg}\x1b[0m")
57
+ end
58
+
59
+ def err(msg)
60
+ STDERR.puts("\x1b[1;31m%% #{msg}\x1b[0m")
61
+ end
54
62
  end
55
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hypertest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey