Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
lib/rspec-steps/stepwise.rb | 39 | 33 | 84.62%
|
87.88%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 module RSpecStepwise |
2 #TODO: This is hacky and needs a more general solution |
3 #Something like cloning the current conf and having RSpec::Stepwise::config ? |
4 def suspend_transactional_fixtures |
5 if self.respond_to? :use_transactional_fixtures |
6 old_val = self.use_transactional_fixtures |
7 self.use_transactional_fixtures = false |
8 |
9 yield |
10 |
11 self.use_transactional_fixtures = old_val |
12 else |
13 yield |
14 end |
15 end |
16 |
17 def run_examples(reporter) |
18 instance = new |
19 set_ivars(instance, before_all_ivars) |
20 |
21 suspend_transactional_fixtures do |
22 filtered_examples.inject(true) do |success, example| |
23 break if RSpec.wants_to_quit |
24 unless success |
25 reporter.example_started(example) |
26 example.metadata[:pending] = true |
27 example.metadata[:execution_result][:pending_message] = "Previous step failed" |
28 example.metadata[:execution_result][:started_at] = Time.now |
29 example.instance_eval{ record_finished :pending, :pending_message => "Previous step failed" } |
30 reporter.example_pending(example) |
31 next |
32 end |
33 succeeded = example.run(instance, reporter) |
34 RSpec.wants_to_quit = true if fail_fast? && !succeeded |
35 success && succeeded |
36 end |
37 end |
38 end |
39 end |
Generated on Fri Apr 22 18:52:20 -0700 2011 with rcov 0.9.8