From 6e5aa75a6ba2a3b8208a667b8fef3b4631614c7e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 29 Oct 2023 09:28:55 +0800 Subject: [PATCH] Add tests with rspec --- Gemfile.lock | 17 +++++- asciidoctor-foodogsquared-extensions.gemspec | 2 + gemset.nix | 64 ++++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 81e91b2..59bc5cb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - asciidoctor-foodogsquared-extensions (1.0.1) + asciidoctor-foodogsquared-extensions (1.1.0) asciidoctor (~> 2.0) rugged (~> 1.0) @@ -10,6 +10,7 @@ GEM specs: asciidoctor (2.0.20) ast (2.4.2) + diff-lcs (1.5.0) json (2.6.3) language_server-protocol (3.17.0.3) parallel (1.23.0) @@ -22,6 +23,19 @@ GEM rake (13.0.6) regexp_parser (2.8.1) rexml (3.2.5) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) rubocop (1.54.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -52,6 +66,7 @@ PLATFORMS DEPENDENCIES asciidoctor-foodogsquared-extensions! rake + rspec (~> 3.0) rubocop ruby-lsp diff --git a/asciidoctor-foodogsquared-extensions.gemspec b/asciidoctor-foodogsquared-extensions.gemspec index 6b3e65d..59bde78 100644 --- a/asciidoctor-foodogsquared-extensions.gemspec +++ b/asciidoctor-foodogsquared-extensions.gemspec @@ -19,4 +19,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'asciidoctor', '~> 2.0' s.add_runtime_dependency 'rugged', '~> 1.0' + + s.add_development_dependency 'rspec', '~> 3.0' end diff --git a/gemset.nix b/gemset.nix index 247f372..a8fdbe6 100644 --- a/gemset.nix +++ b/gemset.nix @@ -29,6 +29,16 @@ }; version = "2.4.2"; }; + diff-lcs = { + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0rwvjahnp7cpmracd8x732rjgnilqv2sx7d1gfrysslc3h039fa9"; + type = "gem"; + }; + version = "1.5.0"; + }; json = { groups = ["default" "lint"]; platforms = []; @@ -130,6 +140,60 @@ }; version = "3.2.5"; }; + rspec = { + dependencies = ["rspec-core" "rspec-expectations" "rspec-mocks"]; + groups = ["development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "171rc90vcgjl8p1bdrqa92ymrj8a87qf6w20x05xq29mljcigi6c"; + type = "gem"; + }; + version = "3.12.0"; + }; + rspec-core = { + dependencies = ["rspec-support"]; + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0l95bnjxdabrn79hwdhn2q1n7mn26pj7y1w5660v5qi81x458nqm"; + type = "gem"; + }; + version = "3.12.2"; + }; + rspec-expectations = { + dependencies = ["diff-lcs" "rspec-support"]; + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "05j44jfqlv7j2rpxb5vqzf9hfv7w8ba46wwgxwcwd8p0wzi1hg89"; + type = "gem"; + }; + version = "3.12.3"; + }; + rspec-mocks = { + dependencies = ["diff-lcs" "rspec-support"]; + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1gq7gviwpck7fhp4y5ibljljvxgjklza18j62qf6zkm2icaa8lfy"; + type = "gem"; + }; + version = "3.12.6"; + }; + rspec-support = { + groups = ["default" "development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1ky86j3ksi26ng9ybd7j0qsdf1lpr8mzrmn98yy9gzv801fvhsgr"; + type = "gem"; + }; + version = "3.12.1"; + }; rubocop = { dependencies = ["json" "language_server-protocol" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"]; groups = ["lint"];