File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ def run_on_modifications(paths)
4242 _throw_if_failed { runner . run ( paths ) }
4343 end
4444
45+ alias run_on_additions run_on_modifications
46+
4547 private
4648
4749 def _throw_if_failed
Original file line number Diff line number Diff line change 8888 plugin . run_on_modifications ( paths )
8989 end
9090 end
91+
92+ describe "#run_on_additions" do
93+ let ( :paths ) { %w[ path1 path2 ] }
94+ it "runs all specs via runner" do
95+ expect ( runner ) . to receive ( :run ) . with ( paths ) { true }
96+ plugin . run_on_additions ( paths )
97+ end
98+
99+ it "does nothing if paths empty" do
100+ expect ( runner ) . to_not receive ( :run )
101+ plugin . run_on_additions ( [ ] )
102+ end
103+
104+ it "throws task_has_failed if runner return false" do
105+ allow ( runner ) . to receive ( :run ) { false }
106+ expect ( plugin ) . to receive ( :throw ) . with ( :task_has_failed )
107+ plugin . run_on_additions ( paths )
108+ end
109+ end
91110end
You can’t perform that action at this time.
0 commit comments