|
484 | 484 | } |
485 | 485 | JSON |
486 | 486 | end |
487 | | - let(:expected_depends_on_macos_variations_os) do |
488 | | - <<~JSON |
489 | | - { |
490 | | - "tahoe": { |
491 | | - "depends_on": { |
492 | | - "macos": { |
493 | | - ">=": [ |
494 | | - "10.15" |
495 | | - ] |
496 | | - } |
497 | | - } |
498 | | - }, |
499 | | - "sequoia": { |
500 | | - "depends_on": { |
501 | | - "macos": { |
502 | | - ">=": [ |
503 | | - "10.15" |
504 | | - ] |
505 | | - } |
506 | | - } |
507 | | - }, |
508 | | - "sonoma": { |
509 | | - "depends_on": { |
510 | | - "macos": { |
511 | | - ">=": [ |
512 | | - "10.15" |
513 | | - ] |
514 | | - } |
515 | | - } |
516 | | - }, |
517 | | - "ventura": { |
518 | | - "depends_on": { |
519 | | - "macos": { |
520 | | - ">=": [ |
521 | | - "10.15" |
522 | | - ] |
523 | | - } |
524 | | - } |
525 | | - }, |
526 | | - "monterey": { |
527 | | - "depends_on": { |
528 | | - "macos": { |
529 | | - ">=": [ |
530 | | - "10.15" |
531 | | - ] |
532 | | - } |
533 | | - } |
534 | | - }, |
535 | | - "big_sur": { |
536 | | - "sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94", |
537 | | - "depends_on": { |
538 | | - "macos": { |
539 | | - ">=": [ |
540 | | - "10.15" |
541 | | - ] |
542 | | - } |
543 | | - } |
544 | | - }, |
545 | | - "arm64_big_sur": { |
546 | | - "sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" |
547 | | - }, |
548 | | - "catalina": { |
549 | | - "sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94", |
550 | | - "depends_on": { |
551 | | - "macos": { |
552 | | - ">=": [ |
553 | | - "10.15" |
554 | | - ] |
555 | | - } |
556 | | - } |
557 | | - } |
558 | | - } |
559 | | - JSON |
560 | | - end |
561 | | - let(:expected_depends_on_arch_variations_os) do |
562 | | - <<~JSON |
563 | | - { |
564 | | - "ventura": { |
565 | | - "sha256": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890" |
566 | | - }, |
567 | | - "arm64_ventura": { |
568 | | - "sha256": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890" |
569 | | - }, |
570 | | - "big_sur": { |
571 | | - "sha256": "d5b2dfbef7ea28c25f7a77cd7fa14d013d82b626db1d82e00e25822464ba19e2", |
572 | | - "depends_on": { |
573 | | - "arch": [ |
574 | | - { |
575 | | - "type": "intel", |
576 | | - "bits": 64 |
577 | | - } |
578 | | - ], |
579 | | - "macos": { |
580 | | - ">=": [ |
581 | | - "10.11" |
582 | | - ] |
583 | | - } |
584 | | - } |
585 | | - } |
586 | | - } |
587 | | - JSON |
588 | | - end |
589 | 487 |
|
590 | 488 | before do |
591 | 489 | # For consistency, always run on Monterey and ARM |
|
621 | 519 | expect(JSON.pretty_generate(h["variations"])).to eq expected_sha256_variations_os.strip |
622 | 520 | end |
623 | 521 |
|
624 | | - it "returns the correct variations hash for a cask with a different `depends_on macos:` for each arch and os" do |
625 | | - c = Cask::CaskLoader.load("with-depends-on-macos-inside-on-arch") |
626 | | - h = c.to_hash_with_variations |
627 | | - |
628 | | - expect(h).to be_a(Hash) |
629 | | - expect(JSON.pretty_generate(h["variations"])).to eq expected_depends_on_macos_variations_os.strip |
630 | | - end |
631 | | - |
632 | | - it "returns the correct variations hash for a cask with a different `depends_on arch:` for some os values" do |
633 | | - c = Cask::CaskLoader.load("with-depends-on-arch-inside-on-os") |
634 | | - h = c.to_hash_with_variations |
635 | | - |
636 | | - expect(h).to be_a(Hash) |
637 | | - expect(JSON.pretty_generate(h["variations"])).to eq expected_depends_on_arch_variations_os.strip |
638 | | - end |
639 | | - |
640 | 522 | # NOTE: The calls to `Cask.generating_hash!` and `Cask.generated_hash!` |
641 | 523 | # are not idempotent so they can only be used in one test. |
642 | 524 | it "returns the correct hash placeholders" do |
|
0 commit comments