Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby

on:
Expand All @@ -20,16 +13,11 @@ jobs:
matrix:
os: [ubuntu-latest]
ruby:
- 2.5
- 2.6
- 2.7
- '2.7'
- '3.0'
- 3.1
- 3.2
- 3.3
include:
- os: macos-13
ruby: 2.5
- '3.1'
- '3.2'
- '3.3'
name: Ruby ${{ matrix.ruby }} test (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -60,6 +48,6 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
ruby-version: 2.7
bundler-cache: true
- run: bin/test/${{ matrix.repo }}
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ source "https://rubygems.org"

# Specify your gem's dependencies in retest.gemspec
gemspec

gem "rake", "~> 13.0"
gem "minitest", "~> 5.0"
gem "byebug"
25 changes: 19 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,41 @@ PATH
GEM
remote: https://rubygems.org/
specs:
byebug (11.1.3)
ffi (1.17.0)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
ffi (1.16.3)
io-console (0.7.2)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
minitest (5.15.0)
minitest (5.25.1)
observer (0.1.2)
rake (13.0.6)
psych (5.1.2)
stringio
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.7.0)
psych (>= 4.0.0)
reline (0.5.10)
io-console (~> 0.5)
string-similarity (2.1.0)
stringio (3.1.1)
tty-option (0.3.0)

PLATFORMS
ruby

DEPENDENCIES
byebug
debug
minitest (~> 5.0)
rake (~> 13.0)
retest!

BUNDLED WITH
2.3.22
2.1.4
2 changes: 1 addition & 1 deletion bin/debug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "byebug"
require "debugger"

begin
eval(File.read("exe/retest"))
Expand Down
3 changes: 2 additions & 1 deletion features/git-ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:2.5.9-alpine3.13

FROM ruby:2.7.8-alpine3.16

ARG BUILD_PACKAGES="build-base git"

Expand Down
3 changes: 2 additions & 1 deletion features/hanami-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:2.5.9-alpine3.13

FROM ruby:2.7.8-alpine3.16

ARG BUILD_PACKAGES="build-base git sqlite-dev"

Expand Down
2 changes: 1 addition & 1 deletion features/hanami-app/spec/features_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

Capybara.app = Hanami.app

class MiniTest::Spec
class Minitest::Spec
include Capybara::DSL
end
3 changes: 2 additions & 1 deletion features/rails-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:2.5.9-alpine3.13

FROM ruby:2.7.8-alpine3.16

ARG BUILD_PACKAGES="build-base git nodejs tzdata sqlite-dev"

Expand Down
3 changes: 2 additions & 1 deletion features/rspec-rails/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:2.5.9-alpine3.13

FROM ruby:2.7.8-alpine3.16

ARG BUILD_PACKAGES="build-base git nodejs tzdata sqlite-dev"

Expand Down
3 changes: 2 additions & 1 deletion features/rspec-ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:2.5.9-alpine3.13

FROM ruby:2.7.8-alpine3.16

ARG BUILD_PACKAGES="build-base git"

Expand Down
3 changes: 2 additions & 1 deletion features/ruby-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:2.5.9-alpine3.13

FROM ruby:2.7.8-alpine3.16

ARG BUILD_PACKAGES="build-base git"

Expand Down
3 changes: 2 additions & 1 deletion features/ruby-bare/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:2.5.9-alpine3.13

FROM ruby:2.7.8-alpine3.16

ARG BUILD_PACKAGES="build-base git"

Expand Down
2 changes: 1 addition & 1 deletion features/ruby-bare/program_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'minitest/autorun'

class SomeTest < MiniTest::Test
class SomeTest < Minitest::Test
def test_the_truth
assert true
end
Expand Down
6 changes: 5 additions & 1 deletion retest.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
spec.summary = "A simple command line tool to watch file change and run its matching spec."
spec.homepage = "https://github.com/AlexB52/retest"
spec.license = "MIT"
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")

# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"

Expand All @@ -29,4 +29,8 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "listen", ["~> 3.9"]
spec.add_runtime_dependency "tty-option", ["~> 0.1"]
spec.add_runtime_dependency "observer", ["~> 0.1"]
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'debug'

end
2 changes: 1 addition & 1 deletion test/fixtures/files/ruby/file_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'minitest/autorun'

class DummyFileTest < MiniTest::Test
class DummyFileTest < Minitest::Test
def test_assertion
assert true
end
Expand Down
4 changes: 2 additions & 2 deletions test/retest/command/auto_flag.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Retest
class AutoFlagTest < MiniTest::Test
class AutoFlagTest < Minitest::Test
SetupFake = Struct.new(:type)

def setup
Expand Down Expand Up @@ -59,7 +59,7 @@ def test_for_unknown_setup
end
end

class AutoAllFlagTest < MiniTest::Test
class AutoAllFlagTest < Minitest::Test
SetupFake = Struct.new(:type)

def setup
Expand Down
2 changes: 1 addition & 1 deletion test/retest/command/rails_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Retest
class Command
class RailsTest < MiniTest::Test
class RailsTest < Minitest::Test
def setup
@subject = Rails.new(all: true, file_system: FakeFS.new([]))
end
Expand Down
2 changes: 1 addition & 1 deletion test/retest/command/rake_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Retest
class Command
class RakeTest < MiniTest::Test
class RakeTest < Minitest::Test
def setup
@subject = Rake.new(all: true, file_system: FakeFS.new([]))
end
Expand Down
2 changes: 1 addition & 1 deletion test/retest/command/rspec_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Retest
class Command
class RspecTest < MiniTest::Test
class RspecTest < Minitest::Test
def setup
@subject = Rspec.new(all: true, file_system: FakeFS.new([]))
end
Expand Down
2 changes: 1 addition & 1 deletion test/retest/command/ruby_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Retest
class Command
class RubyTest < MiniTest::Test
class RubyTest < Minitest::Test
def setup
@subject = Ruby.new(all: true, file_system: FakeFS.new([]))
end
Expand Down
4 changes: 2 additions & 2 deletions test/retest/command_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_relative 'command/auto_flag'

module Retest
class OptionsCommandTest < MiniTest::Test
class OptionsCommandTest < Minitest::Test
def setup
@subject = Command.new stdout: StringIO.new
end
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_mixed_options
end
end

class SetupCommandTest < MiniTest::Test
class SetupCommandTest < Minitest::Test
FakeSetup = Struct.new(:type)

def read_output
Expand Down
4 changes: 2 additions & 2 deletions test/retest/file_system_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def test_interface
end

module Retest
class FileSystemTest < MiniTest::Test
class FileSystemTest < Minitest::Test
include FileSystemShared

def setup
Expand All @@ -19,7 +19,7 @@ def test_exists?
end
end

class FakeFSTest < MiniTest::Test
class FakeFSTest < Minitest::Test
include FileSystemShared

def setup
Expand Down
2 changes: 1 addition & 1 deletion test/retest/matching_options/path_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Retest
class MatchingOptions
class PathTest < MiniTest::Test
class PathTest < Minitest::Test
def setup
@subject = Path.new('test/models/taxation/test_holdings.rb')
end
Expand Down
8 changes: 4 additions & 4 deletions test/retest/matching_options_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test_helper'

module Retest
class TestRootLevelFiles < MiniTest::Test
class TestRootLevelFiles < Minitest::Test
def test_root_file_level
files = %w(foo_spec.rb)

Expand All @@ -17,7 +17,7 @@ def test_root_file_level
end
end

class TestPrefixPatternTest < MiniTest::Test
class TestPrefixPatternTest < Minitest::Test
def test_find_test
files = %w(
test/songs/99bottles.txt
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_no_namespace_matching
end
end

class TestSuffixPatternTest < MiniTest::Test
class TestSuffixPatternTest < Minitest::Test
def test_find_test
files = %w(
test/songs/99bottles.txt
Expand Down Expand Up @@ -121,7 +121,7 @@ def test_no_namespace_matching
end
end

class MultiplePatternTest < MiniTest::Test
class MultiplePatternTest < Minitest::Test
def test_no_default_pattern_match
files = %w(
lib/active_record/fixtures.rb
Expand Down
2 changes: 1 addition & 1 deletion test/retest/options_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test_helper'

module Retest
class OptionsTest < MiniTest::Test
class OptionsTest < Minitest::Test
def setup
@subject = Options.new
end
Expand Down
32 changes: 15 additions & 17 deletions test/retest/program_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,25 @@

# TODO : write missing tests
module Retest
class ProgramTest < MiniTest::Test
class PauseTest < Minitest::Test
def setup
@subject = Program.new(repository: Repository.new, clear_window: false)
end
class PauseTest < Minitest::Test
def setup
@subject = Program.new(repository: Repository.new, clear_window: false)
end

def test_paused?
refute @subject.paused?
def test_paused?
refute @subject.paused?

@subject.pause
assert @subject.paused?
@subject.pause
assert @subject.paused?

@subject.resume
refute @subject.paused?
end
@subject.resume
refute @subject.paused?
end

def test_no_run_when_paused
@subject.runner = RaisingRunner.new
@subject.pause
@subject.run(['modified'], ['added'], ['removed'])
end
def test_no_run_when_paused
@subject.runner = RaisingRunner.new
@subject.pause
@subject.run(['modified'], ['added'], ['removed'])
end
end
end
2 changes: 1 addition & 1 deletion test/retest/prompt_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test_helper'

module Retest
class PromptTest < MiniTest::Test
class PromptTest < Minitest::Test
MethodCall = Struct.new(:name, :args, keyword_init: true)
class FakeObserver
attr_reader :notepad
Expand Down
Loading