diff options
Diffstat (limited to 'crates/shirabe/tests')
| -rw-r--r-- | crates/shirabe/tests/plugin/subscriber_test.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/shirabe/tests/plugin/subscriber_test.rs b/crates/shirabe/tests/plugin/subscriber_test.rs index 1d6a7ece..a08d8d8d 100644 --- a/crates/shirabe/tests/plugin/subscriber_test.rs +++ b/crates/shirabe/tests/plugin/subscriber_test.rs @@ -104,12 +104,18 @@ fn test_remove_plugin_removes_its_subscribed_listeners() { assert_eq!(0, dispatch(&set_up, "post-install-cmd")); + // The worker is shared across tests: when another test already defined the plugin class, + // this install registered it under a `_composer_tmpN` rename (as upstream does). let plugin = set_up .pm .borrow() .get_plugins() .iter() - .find(|p| p.borrow().get_class_name() == "Subscriber\\Plugin") + .find(|p| { + p.borrow() + .get_class_name() + .starts_with("Subscriber\\Plugin") + }) .expect("the subscriber plugin is registered") .clone(); set_up.pm.borrow_mut().remove_plugin(&plugin).unwrap(); |
