Class: MountainBerryFields::Test::RSpec
- Inherits:
-
Object
- Object
- MountainBerryFields::Test::RSpec
- Includes:
- Strategy
- Defined in:
- lib/mountain_berry_fields/test/rspec.rb,
lib/mountain_berry_fields/test/rspec_formatter.rb
Defined Under Namespace
Classes: Formatter
Instance Method Summary collapse
Instance Method Details
#failure_message ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/mountain_berry_fields/test/rspec.rb', line 43 def || "#{spec_failure_description.chomp}:\n" \ " #{.chomp}\n" \ "\n" \ "backtrace:\n" \ " #{spec_failure_backtrace.join "\n "}\n" end |
#pass? ⇒ Boolean
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/mountain_berry_fields/test/rspec.rb', line 23 def pass? @passed ||= syntax_checker.valid? && begin dir_class.mktmpdir 'mountain_berry_fields_rspec' do |dir| @tempdir_name = dir file_class.write "#{dir}/spec.rb", @code_to_test @output, @error, status = open3_class.capture3 "rspec '#{dir}/spec.rb' " \ "-r '#{formatter_filename}' " \ "-f MountainBerryFields::Test::RSpec::Formatter " \ "--fail-fast" status.success? end end @passed end |
#syntax_checker ⇒ Object
15 16 17 |
# File 'lib/mountain_berry_fields/test/rspec.rb', line 15 def syntax_checker @syntax_checker ||= syntax_checker_class.new code_to_test end |
#syntax_error_message ⇒ Object
38 39 40 41 |
# File 'lib/mountain_berry_fields/test/rspec.rb', line 38 def return if syntax_checker.valid? syntax_checker. end |