Skip to content

Instantly share code, notes, and snippets.

@shigeya
Created May 20, 2014 22:16
Show Gist options
  • Save shigeya/82b6279a41cd362c8422 to your computer and use it in GitHub Desktop.
Save shigeya/82b6279a41cd362c8422 to your computer and use it in GitHub Desktop.
Diff to make RubyMine 6.3.2's rspec3 support to compatible with RSpec 3.0.0rc1
--- rspec3_formatter.rb.FCS 2014-05-21 07:14:30.000000000 +0900
+++ rspec3_formatter.rb 2014-05-21 07:15:17.000000000 +0900
@@ -132,7 +132,7 @@
# Start capturing...
std_files = capture_output_start_external
- started_at_ms = get_time_in_ms(example.execution_result[:started_at])
+ started_at_ms = get_time_in_ms(example.execution_result.started_at)
debug_log('Output capturing started.')
@@ -196,7 +196,7 @@
def example_pending(example_notification)
example = example_notification.example
- message = example.execution_result[:pending_message]
+ message = example.execution_result.pending_message
debug_log("pending: #{example_description(example)}, #{message}, #{example}")
# stop capturing
@@ -246,9 +246,10 @@
debug_log(status_message)
log(status_message)
- #Really must be '@count_notification == count_notification', it is hack for spec trunk tests
- if !@setup_failed && @count_notification > count_notification
- msg = "#{RUNNER_ISNT_COMPATIBLE_MESSAGE}Error: Not all examples have been run! (#{count_notification} of #{@count_notification})¥n#{gather_unfinished_examples_name}"
+ c_notification = example_count+failure_count+pending_count
+ #Really must be '@count_notification == c_notification', it is hack for spec trunk tests
+ if !@setup_failed && @count_notification && @count_notification > c_notification
+ msg = "#{RUNNER_ISNT_COMPATIBLE_MESSAGE}Error: Not all examples have been run! (#{c_notification} of #{@count_notification})¥n#{gather_unfinished_examples_name}"
log_and_raise_internal_error msg
debug_log(msg)
@@ -330,14 +331,14 @@
def close_test_block(example)
example_data = remove_data_from_storage(example)
- finished_at_ms = get_time_in_ms(example.execution_result[:finished_at])
+ finished_at_ms = get_time_in_ms(example.execution_result.finished_at)
duration = finished_at_ms - example_data.start_time_in_ms
additional_flowid_suffix = example_data.additional_flowid_suffix
running_example_full_name = example_data.full_name
debug_log("Example finishing... full example name = [#{running_example_full_name}], duration = #{duration} ms, additional flowid suffix=[#{additional_flowid_suffix}]")
- diagnostic_info = "rspec [#{::RSpec::Core::Version::STRING}]" + ", f/s=(#{finished_at_ms}, #{example_data.start_time_in_ms}), duration=#{duration}, time.now=#{Time.now.to_s}, raw[:started_at]=#{example.execution_result[:started_at].to_s}, raw[:finished_at]=#{example.execution_result[:finished_at].to_s}, raw[:run_time]=#{example.execution_result[:run_time].to_s}"
+ diagnostic_info = "rspec [#{::RSpec::Core::Version::STRING}]" + ", f/s=(#{finished_at_ms}, #{example_data.start_time_in_ms}), duration=#{duration}, time.now=#{Time.now.to_s}, raw[:started_at]=#{example.execution_result.started_at.to_s}, raw[:finished_at]=#{example.execution_result.finished_at.to_s}, raw[:run_time]=#{example.execution_result.run_time.to_s}"
log(@message_factory.create_test_finished(running_example_full_name, duration, ::Rake::TeamCity.is_in_buildserver_mode ? nil : diagnostic_info))
end
@@ -450,4 +451,3 @@
end
end
end
-
@ndp
Copy link

ndp commented Jun 19, 2014

new version of RubyMine (today) fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment