Skip to content

Commit

Permalink
Relocate plugins command unit test to feature test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Jan 24, 2025
1 parent 261662a commit f65f7f2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 34 deletions.
5 changes: 3 additions & 2 deletions bridgetown-core/test/features/feature_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ def after_teardown

####

def run_bridgetown(command, args = "", skip_status_check: false)
def run_bridgetown(command, args = "", skip_status_check: false, trace: true)
args = args.strip.split # Shellwords?
process, output = exec_command("ruby", Paths.bridgetown_bin.to_s, command, *args, "--trace")
args << "--trace" if trace
process, output = exec_command("ruby", Paths.bridgetown_bin.to_s, command, *args)
unless skip_status_check
assert process.exitstatus.zero?, "Bridgetown process failed: #{process} \n#{output}"
end
Expand Down
23 changes: 23 additions & 0 deletions bridgetown-core/test/features/test_plugins_command.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

require "features/feature_helper"

class TestPluginsCommand < BridgetownFeatureTest
describe "list registered plugins" do
before do
create_directory "config"
create_file "config/initializers.rb", <<~RUBY
Bridgetown.configure do |config|
end
RUBY
end

it "excludes init (Initializer) from registered plugins list" do
_, output = run_bridgetown "plugins", "list", trace: false
output = Bridgetown::Foundation::Packages::Ansi.strip(output)

refute_includes output, "init (Initializer)"
assert_includes output, "Registered Plugins: 5"
end
end
end
32 changes: 0 additions & 32 deletions bridgetown-core/test/test_plugins_command.rb

This file was deleted.

0 comments on commit f65f7f2

Please sign in to comment.