Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Open
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
4 changes: 4 additions & 0 deletions bin/learn-test
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ OptionParser.new do |opts|
(options[:example] ||= []) << s
end

opts.on("-w", "--run-rspec-with-ruby-warnings-on", "Runs RSpec with Ruby warnings enabled ('-w')") do |w|
options[:ruby_warnings] = w
end

if ARGV.any? { |arg| arg == "init" }
options[:init] = true
end
Expand Down
8 changes: 8 additions & 0 deletions lib/learn_test/strategies/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def configure
argv << '--fail-fast'
end

if warning_option_present?
argv << '-w'
end

if example_option_present?
argv << options[:example].map{|e| "--example #{e}"}.join(" ")
end
Expand Down Expand Up @@ -91,6 +95,10 @@ def example_option_present?
options[:example]
end

def warning_option_present?
options[:ruby_warnings]
end

def dot_rspec
@dot_rspec ||= File.readlines('.rspec').map(&:strip) if File.exist?('.rspec')
end
Expand Down