Skip to content

Commit

Permalink
add version command and rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaumik-Ashraf committed Jan 25, 2024
1 parent 54713d5 commit 1cf66b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/inferno/apps/cli/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require_relative 'suite'
require_relative 'suites'
require_relative 'new'
require_relative '../../version'

module Inferno
module CLI
Expand Down Expand Up @@ -52,6 +53,11 @@ def suites
subcommand 'suite', Suite

register(New, 'new', 'new TEST_KIT_NAME', 'Run `inferno new --help` for full help')

desc 'version', "Output Inferno core version (#{Inferno::VERSION})"
def version
puts Inferno::VERSION
end
end
end
end
12 changes: 12 additions & 0 deletions lib/inferno/apps/cli/main_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'rspec'
require 'thor'
require 'inferno/apps/cli/main'
require 'inferno/version'

RSpec.describe Inferno::CLI::Main do # rubocop:disable RSpec/FilePath
context 'with version command' do
it 'outputs current Inferno version' do
expect { described_class.new.version }.to output("#{Inferno::VERSION}\n").to_stdout
end
end
end

0 comments on commit 1cf66b0

Please sign in to comment.