Skip to content

Commit

Permalink
Added separate integration specs.
Browse files Browse the repository at this point in the history
* This speeds up the normal `rake spec` test suite, and reduces the need
  to install `javac` or `mingw64-gcc` just to run the test suite.
* The non-integration tests can be ran via `rake spec`.
* The integration tests can be ran via `rake spec:integration`.
* The entire test suite can be ran via `rake test`.
  • Loading branch information
postmodern committed Aug 16, 2024
1 parent 8a676f4 commit f68a794
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
9 changes: 8 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ Gem::Tasks.new(sign: {checksum: true, pgp: true})

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task :test => :spec

namespace :spec do
RSpec::Core::RakeTask.new(:integration) do |t|
t.rspec_opts = '--tag integration'
end
end

task :test => [:spec, 'spec:integration']
task :default => :spec

require 'yard'
Expand Down
2 changes: 1 addition & 1 deletion spec/builtin/bin/unix/reverse_shell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
)
end

describe "#build" do
describe "#build", :integration do
before { subject.build }

it "must set #payload" do
Expand Down
2 changes: 1 addition & 1 deletion spec/builtin/bin/windows/reverse_shell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
)
end

describe "#build" do
describe "#build", :integration do
before { subject.build }

it "must set #payload" do
Expand Down
2 changes: 1 addition & 1 deletion spec/builtin/java/reverse_shell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
end

describe "#build" do
describe "#build", :integration do
before { subject.perform_build }

it "must generate generate a new .java file containing the host and port" do
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
require 'simplecov'

SimpleCov.start

RSpec.configure do |specs|
specs.filter_run_excluding :integration
end

0 comments on commit f68a794

Please sign in to comment.