This repository was archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 753
Fix for #1280 #1289
Merged
Merged
Fix for #1280 #1289
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
feead38
Refactor: remove special cases from configuration options.
myronmarston b2fea38
Rename `parse_options` to `options` and have it return a memoized value.
myronmarston b342ffb
Allow `files_to_run` to be used in `spec_helper` when loaded early vi…
myronmarston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,7 +231,7 @@ def treat_symbols_as_metadata_keys_with_true_values=(value) | |
# @private | ||
add_setting :include_or_extend_modules | ||
# @private | ||
add_setting :files_to_run | ||
attr_writer :files_to_run | ||
# @private | ||
add_setting :expecting_with_rspec | ||
# @private | ||
|
@@ -248,7 +248,7 @@ def initialize | |
@expectation_frameworks = [] | ||
@include_or_extend_modules = [] | ||
@mock_framework = nil | ||
@files_to_run = [] | ||
@files_or_directories_to_run = [] | ||
@color = false | ||
@pattern = '**/*_spec.rb' | ||
@failure_exit_code = 1 | ||
|
@@ -620,7 +620,12 @@ def profile_examples | |
def files_or_directories_to_run=(*files) | ||
files = files.flatten | ||
files << default_path if (command == 'rspec' || Runner.running_in_drb?) && default_path && files.empty? | ||
self.files_to_run = get_files_to_run(files) | ||
@files_or_directories_to_run = files | ||
@files_to_run = nil | ||
end | ||
|
||
def files_to_run | ||
@files_to_run ||= get_files_to_run(@files_or_directories_to_run) | ||
end | ||
|
||
# Creates a method that delegates to `example` including the submitted | ||
|
@@ -897,7 +902,7 @@ def safe_include(mod, host) | |
end | ||
|
||
# @private | ||
def setup_load_path_and_require(paths) | ||
def requires=(paths) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the name change? it's still manipulating the load path.... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because in feead38 I did some prep refactoring that removed calling |
||
directories = ['lib', default_path].select { |p| File.directory? p } | ||
RSpec::Core::RubyProject.add_to_load_path(*directories) | ||
paths.each {|path| require path} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An aside, is this for relish?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the
"""ruby
bit? Yes, that's for relish -- it tells it what kind of text it is, so it can apply syntax highlighting.