Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add framework & version methods #14

Merged
merged 1 commit into from
Dec 29, 2023
Merged
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
13 changes: 13 additions & 0 deletions lib/selective/ruby/rspec/runner_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class TestManifestError < StandardError; end

attr_reader :args, :rspec_runner, :config

FRAMEWORK = "rspec"
DEFAULT_SPEC_PATH = "./spec"

def initialize(args)
Expand Down Expand Up @@ -78,6 +79,18 @@ def finish
::RSpec.world.reporter.finish
end

def framework
RunnerWrapper::FRAMEWORK
end

def framework_version
::RSpec::Core::Version::STRING
end

def wrapper_version
RSpec::VERSION
end

private

def run_test_case(test_case_id, callback)
Expand Down
18 changes: 18 additions & 0 deletions spec/selective/ruby/rspec/runner_wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,22 @@
expect(runner_wrapper.failure_formatter(meta_example).keys).to include(:failure_message_lines, :failure_formatted_backtrace)
end
end

describe '#framework' do
it 'returns the expected value' do
expect(runner_wrapper.framework).to eq('rspec')
end
end

describe '#framework_version' do
it 'returns the current rspec core version' do
expect(runner_wrapper.framework_version).to eq(::RSpec::Core::Version::STRING)
end
end

describe '#wrapper_version' do
it 'returns gem version' do
expect(runner_wrapper.wrapper_version).to eq(Selective::Ruby::RSpec::VERSION)
end
end
end
Loading