|
601 | 601 | as_single_line: false, |
602 | 602 | ) |
603 | 603 | expect(inspection).to match( |
604 | | - /#<SuperDiff::Test::EmptyClass:0x[a-z0-9]+>/ |
| 604 | + /#<SuperDiff::Test::EmptyClass:0x[a-z0-9]+>/, |
605 | 605 | ) |
606 | 606 | end |
607 | 607 | end |
|
734 | 734 | end |
735 | 735 | end |
736 | 736 |
|
| 737 | + context "given a kind-of-<something>" do |
| 738 | + context "given as_single_line: true" do |
| 739 | + it "returns a representation of the object on a single line" do |
| 740 | + inspection = described_class.inspect( |
| 741 | + a_kind_of(Symbol), |
| 742 | + as_single_line: true, |
| 743 | + ) |
| 744 | + |
| 745 | + expect(inspection).to eq(%(#<a kind of Symbol>)) |
| 746 | + end |
| 747 | + end |
| 748 | + |
| 749 | + context "given as_single_line: false" do |
| 750 | + it "returns a representation of the object on a single line" do |
| 751 | + inspection = described_class.inspect( |
| 752 | + a_kind_of(Symbol), |
| 753 | + as_single_line: false, |
| 754 | + ) |
| 755 | + |
| 756 | + expect(inspection).to eq(%(#<a kind of Symbol>)) |
| 757 | + end |
| 758 | + end |
| 759 | + end |
| 760 | + |
| 761 | + context "given an-instance-of-<something>" do |
| 762 | + context "given as_single_line: true" do |
| 763 | + it "returns a representation of the object on a single line" do |
| 764 | + inspection = described_class.inspect( |
| 765 | + an_instance_of(Symbol), |
| 766 | + as_single_line: true, |
| 767 | + ) |
| 768 | + |
| 769 | + expect(inspection).to eq(%(#<an instance of Symbol>)) |
| 770 | + end |
| 771 | + end |
| 772 | + |
| 773 | + context "given as_single_line: false" do |
| 774 | + it "returns a representation of the object on a single line" do |
| 775 | + inspection = described_class.inspect( |
| 776 | + an_instance_of(Symbol), |
| 777 | + as_single_line: false, |
| 778 | + ) |
| 779 | + |
| 780 | + expect(inspection).to eq(%(#<an instance of Symbol>)) |
| 781 | + end |
| 782 | + end |
| 783 | + end |
| 784 | + |
| 785 | + context "given a-value-within-<something>" do |
| 786 | + context "given as_single_line: true" do |
| 787 | + it "returns a representation of the object on a single line" do |
| 788 | + inspection = described_class.inspect( |
| 789 | + a_value_within(1).of(Time.utc(2020, 4, 9)), |
| 790 | + as_single_line: true, |
| 791 | + ) |
| 792 | + |
| 793 | + expect(inspection).to eq( |
| 794 | + %(#<a value within 1 of 2020-04-09 00:00:00.000 UTC +00:00 (Time)>), |
| 795 | + ) |
| 796 | + end |
| 797 | + end |
| 798 | + |
| 799 | + context "given as_single_line: false" do |
| 800 | + it "returns a representation of the object on a single line" do |
| 801 | + inspection = described_class.inspect( |
| 802 | + a_value_within(1).of(Time.utc(2020, 4, 9)), |
| 803 | + as_single_line: false, |
| 804 | + ) |
| 805 | + |
| 806 | + expect(inspection).to eq( |
| 807 | + %(#<a value within 1 of 2020-04-09 00:00:00.000 UTC +00:00 (Time)>), |
| 808 | + ) |
| 809 | + end |
| 810 | + end |
| 811 | + end |
| 812 | + |
737 | 813 | context "given a Double" do |
738 | 814 | context "that is anonymous" do |
739 | 815 | context "given as_single_line: true" do |
|
0 commit comments