File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 680
680
end
681
681
end
682
682
683
+ context "given an ActiveRecord object" do
684
+ context "given as_single_line: true" do
685
+ it "returns a representation of the object on a single line" do
686
+ inspection = described_class . inspect (
687
+ SuperDiff ::Test ::Models ::ActiveRecord ::Person . new (
688
+ name : "Elliot" ,
689
+ age : 31 ,
690
+ ) ,
691
+ as_single_line : true ,
692
+ )
693
+
694
+ expect ( inspection ) . to eq (
695
+ %(#<SuperDiff::Test::Models::ActiveRecord::Person id: nil, age: 31, name: "Elliot">)
696
+ )
697
+ end
698
+ end
699
+
700
+ context "given as_single_line: false" do
701
+ it "returns a representation of the object across multiple lines" do
702
+ inspection = described_class . inspect (
703
+ SuperDiff ::Test ::Models ::ActiveRecord ::Person . new (
704
+ name : "Elliot" ,
705
+ age : 31 ,
706
+ ) ,
707
+ as_single_line : false ,
708
+ )
709
+
710
+ expect ( inspection ) . to eq ( <<~INSPECTION . rstrip )
711
+ #<SuperDiff::Test::Models::ActiveRecord::Person {
712
+ id: nil,
713
+ age: 31,
714
+ name: "Elliot"
715
+ }>
716
+ INSPECTION
717
+ end
718
+ end
719
+ end
720
+
683
721
context "given a combination of all kinds of values" do
684
722
context "given as_single_line: true" do
685
723
it "returns a representation of the object on a single line" do
You can’t perform that action at this time.
0 commit comments