|
1283 | 1283 | expect(holdouts.length).to eq(1) |
1284 | 1284 | expect(holdouts.first['key']).to eq('global_holdout') |
1285 | 1285 | end |
| 1286 | + |
| 1287 | + it 'debug test data' do |
| 1288 | + puts "=== DEBUG INFO ===" |
| 1289 | + puts "Holdouts: #{config_with_holdouts.holdouts.inspect}" |
| 1290 | + puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}" |
| 1291 | + puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}" |
| 1292 | + puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}" |
| 1293 | + |
| 1294 | + # Check feature flag IDs |
| 1295 | + puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}" |
| 1296 | + puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}" |
| 1297 | + end |
1286 | 1298 | end |
1287 | 1299 |
|
1288 | 1300 | describe '#get_holdout' do |
|
1314 | 1326 | holdout = config_with_holdouts.get_holdout('non_existent_holdout') |
1315 | 1327 | expect(holdout).to be_nil |
1316 | 1328 | end |
| 1329 | + |
| 1330 | + it 'debug test data' do |
| 1331 | + puts "=== DEBUG INFO ===" |
| 1332 | + puts "Holdouts: #{config_with_holdouts.holdouts.inspect}" |
| 1333 | + puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}" |
| 1334 | + puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}" |
| 1335 | + puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}" |
| 1336 | + |
| 1337 | + # Check feature flag IDs |
| 1338 | + puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}" |
| 1339 | + puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}" |
| 1340 | + end |
1317 | 1341 | end |
1318 | 1342 |
|
1319 | 1343 | describe '#get_holdout with logging' do |
|
1352 | 1376 | anything |
1353 | 1377 | ) |
1354 | 1378 | end |
| 1379 | + |
| 1380 | + it 'debug test data' do |
| 1381 | + puts "=== DEBUG INFO ===" |
| 1382 | + puts "Holdouts: #{config_with_holdouts.holdouts.inspect}" |
| 1383 | + puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}" |
| 1384 | + puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}" |
| 1385 | + puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}" |
| 1386 | + |
| 1387 | + # Check feature flag IDs |
| 1388 | + puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}" |
| 1389 | + puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}" |
| 1390 | + end |
1355 | 1391 | end |
1356 | 1392 |
|
1357 | 1393 | describe 'holdout initialization' do |
|
1392 | 1428 | multi_variate_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'multi_variate_feature' }['id'] |
1393 | 1429 | empty_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'empty_feature' }['id'] |
1394 | 1430 |
|
| 1431 | + expect(config_with_complex_holdouts.included_holdouts[multi_variate_feature_id]).not_to be_nil |
1395 | 1432 | expect(config_with_complex_holdouts.included_holdouts[multi_variate_feature_id]).not_to be_empty |
| 1433 | + expect(config_with_complex_holdouts.included_holdouts[empty_feature_id]).not_to be_nil |
1396 | 1434 | expect(config_with_complex_holdouts.included_holdouts[empty_feature_id]).not_to be_empty |
1397 | 1435 | expect(config_with_complex_holdouts.included_holdouts[boolean_feature_id]).to be_nil |
1398 | 1436 |
|
1399 | 1437 | string_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'string_single_variable_feature' }['id'] |
1400 | 1438 |
|
| 1439 | + expect(config_with_complex_holdouts.excluded_holdouts[boolean_feature_id]).not_to be_nil |
1401 | 1440 | expect(config_with_complex_holdouts.excluded_holdouts[boolean_feature_id]).not_to be_empty |
| 1441 | + expect(config_with_complex_holdouts.excluded_holdouts[string_feature_id]).not_to be_nil |
1402 | 1442 | expect(config_with_complex_holdouts.excluded_holdouts[string_feature_id]).not_to be_empty |
1403 | 1443 | end |
1404 | 1444 |
|
|
1408 | 1448 |
|
1409 | 1449 | boolean_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'boolean_feature' }['id'] |
1410 | 1450 | included_for_boolean = config_with_complex_holdouts.included_holdouts[boolean_feature_id] |
1411 | | - expect(included_for_boolean).to be_nil_or_empty |
| 1451 | + expect(included_for_boolean).to be_nil |
| 1452 | + end |
| 1453 | + |
| 1454 | + it 'debug test data' do |
| 1455 | + puts "=== DEBUG INFO ===" |
| 1456 | + puts "Holdouts: #{config_with_holdouts.holdouts.inspect}" |
| 1457 | + puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}" |
| 1458 | + puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}" |
| 1459 | + puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}" |
| 1460 | + |
| 1461 | + # Check feature flag IDs |
| 1462 | + puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}" |
| 1463 | + puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}" |
1412 | 1464 | end |
1413 | 1465 | end |
1414 | 1466 | end |
0 commit comments