File tree 2 files changed +18
-4
lines changed 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,11 @@ def rspec(*rspec_args)
23
23
start_sink ( jobs : jobs , workers : workers , formatter : formatter )
24
24
end
25
25
26
+ private
27
+
26
28
def formatter
27
29
@formatter ||= begin
28
- formatter_klass = " Flatware::RSpec::Formatters:: #{ options [ :formatter ] . capitalize } " . constantize
30
+ formatter_klass = Flatware ::RSpec ::Formatters . const_get ( options [ :formatter ] . capitalize )
29
31
30
32
formatter_klass . new (
31
33
::RSpec . configuration . output_stream ,
Original file line number Diff line number Diff line change 5
5
context 'when example_passed' do
6
6
it "sends a 'passed' progress message to the sink client" do
7
7
formatter = described_class . new StringIO . new
8
- example = double 'Example'
8
+ example = double 'Example' , full_description : 'example description' ,
9
+ location : 'here' ,
10
+ location_rerun_argument : 'here[1]' ,
11
+ metadata : { } ,
12
+ execution_result : double (
13
+ 'Execution result' ,
14
+ status : :passed ,
15
+ exception : nil ,
16
+ finished_at : Time . now ,
17
+ run_time : 0.1 ,
18
+ started_at : Time . now - 0.1
19
+ )
20
+ notification = double 'Notification' , example : example
9
21
client = double 'Client' , progress : true
10
22
Flatware ::Sink . client = client
11
- formatter . example_passed example
23
+ formatter . example_passed notification
12
24
13
25
expect ( client ) . to have_received ( :progress ) . with anything do |message |
14
- expect ( message . progress ) . to eq :passed
26
+ expect ( message . example . execution_result . status ) . to eq :passed
15
27
true
16
28
end
17
29
end
You can’t perform that action at this time.
0 commit comments