It looks like this pattern is needed in a few places, so I would suggest having a helper to temporarily register a global filter.  E.g.

```ruby
    with_global_filter(global) do
      assert_equal 'Global test', Template.parse("{{'test' | notice }}").render!
      assert_equal 'Local test', Template.parse("{{'test' | notice }}").render!({}, :filters => [local])
    end
```

then move `Template.register_filter(global)` and the ensure block into that helper function.  That way we only need to change that helper function if the Strainer internals change in a way that requires these this cleanup to change.