@@ -215,6 +215,36 @@ func TestCargoTestFilterIntegration(t *testing.T) {
215215 }
216216}
217217
218+ func TestRSpecFilterIntegration (t * testing.T ) {
219+ fixture := loadFixture (t , "rspec_raw.txt" )
220+ f := loadFilter (t , "rspec.yaml" )
221+
222+ filtered , err := applyPipeline (f , fixture )
223+ if err != nil {
224+ t .Fatalf ("apply pipeline: %v" , err )
225+ }
226+
227+ // Should be much shorter
228+ if len (filtered ) >= len (fixture ) {
229+ t .Errorf ("filtered (%d) not shorter than input (%d)" , len (filtered ), len (fixture ))
230+ }
231+
232+ // Should contain summary
233+ if ! strings .Contains (filtered , "examples" ) {
234+ t .Error ("filtered output missing examples count" )
235+ }
236+
237+ // Should preserve failure paths (essential for debugging)
238+ if strings .Contains (fixture , "rspec ./" ) && ! strings .Contains (filtered , "rspec ./" ) {
239+ t .Error ("filtered output missing failure paths (rspec ./spec/...)" )
240+ }
241+
242+ inputTokens := utils .EstimateTokens (fixture )
243+ outputTokens := utils .EstimateTokens (filtered )
244+ savings := float64 (inputTokens - outputTokens ) / float64 (inputTokens ) * 100
245+ t .Logf ("rspec: %d -> %d tokens (%.1f%% savings)" , inputTokens , outputTokens , savings )
246+ }
247+
218248// Edge case tests
219249func TestFilterEmptyInput (t * testing.T ) {
220250 f := loadFilter (t , "git-log.yaml" )
@@ -256,6 +286,82 @@ func TestFilterANSIInput(t *testing.T) {
256286 }
257287}
258288
289+ func TestBundleInstallFilterIntegration (t * testing.T ) {
290+ fixture := loadFixture (t , "bundle_install_raw.txt" )
291+ f := loadFilter (t , "bundle-install.yaml" )
292+
293+ filtered , err := applyPipeline (f , fixture )
294+ if err != nil {
295+ t .Fatalf ("apply pipeline: %v" , err )
296+ }
297+
298+ if len (filtered ) >= len (fixture ) {
299+ t .Errorf ("filtered (%d) not shorter than input (%d)" , len (filtered ), len (fixture ))
300+ }
301+
302+ if ! strings .Contains (filtered , "Bundle complete" ) {
303+ t .Error ("filtered output missing Bundle complete" )
304+ }
305+
306+ // Calculate and log token savings
307+ inputTokens := utils .EstimateTokens (fixture )
308+ outputTokens := utils .EstimateTokens (filtered )
309+ savings := float64 (inputTokens - outputTokens ) / float64 (inputTokens ) * 100
310+ t .Logf ("bundle-install: %d -> %d tokens (%.1f%% savings)" , inputTokens , outputTokens , savings )
311+ }
312+
313+ func TestRailsRoutesFilterIntegration (t * testing.T ) {
314+ fixture := loadFixture (t , "rails_routes_raw.txt" )
315+ f := loadFilter (t , "rails-routes.yaml" )
316+
317+ filtered , err := applyPipeline (f , fixture )
318+ if err != nil {
319+ t .Fatalf ("apply pipeline: %v" , err )
320+ }
321+
322+ // Should be shorter
323+ if len (filtered ) >= len (fixture ) {
324+ t .Errorf ("filtered (%d) not shorter than input (%d)" , len (filtered ), len (fixture ))
325+ }
326+
327+ // Should contain routes total summary
328+ if ! strings .Contains (filtered , "routes total" ) {
329+ t .Error ("filtered output missing 'routes total'" )
330+ }
331+
332+ // Calculate and log token savings
333+ inputTokens := utils .EstimateTokens (fixture )
334+ outputTokens := utils .EstimateTokens (filtered )
335+ savings := float64 (inputTokens - outputTokens ) / float64 (inputTokens ) * 100
336+ t .Logf ("rails-routes: %d -> %d tokens (%.1f%% savings)" , inputTokens , outputTokens , savings )
337+ }
338+
339+ func TestRailsMigrateFilterIntegration (t * testing.T ) {
340+ fixture := loadFixture (t , "rails_migrate_raw.txt" )
341+ f := loadFilter (t , "rails-migrate.yaml" )
342+
343+ filtered , err := applyPipeline (f , fixture )
344+ if err != nil {
345+ t .Fatalf ("apply pipeline: %v" , err )
346+ }
347+
348+ // Should be shorter
349+ if len (filtered ) >= len (fixture ) {
350+ t .Errorf ("filtered (%d) not shorter than input (%d)" , len (filtered ), len (fixture ))
351+ }
352+
353+ // Should contain migrations executed summary
354+ if ! strings .Contains (filtered , "migrations executed" ) {
355+ t .Error ("filtered output missing 'migrations executed'" )
356+ }
357+
358+ // Calculate and log token savings
359+ inputTokens := utils .EstimateTokens (fixture )
360+ outputTokens := utils .EstimateTokens (filtered )
361+ savings := float64 (inputTokens - outputTokens ) / float64 (inputTokens ) * 100
362+ t .Logf ("rails-migrate: %d -> %d tokens (%.1f%% savings)" , inputTokens , outputTokens , savings )
363+ }
364+
259365func TestGracefulDegradation (t * testing.T ) {
260366 // Bad filter YAML
261367 badYAML := `
0 commit comments