diff --git a/spec/objects_spec.rb b/spec/objects_spec.rb index ee7d241..cdbfa40 100644 --- a/spec/objects_spec.rb +++ b/spec/objects_spec.rb @@ -77,6 +77,50 @@ EOS attr_reader :abra = 1, attr_writer :ca = 2 > +EOS + expect(out.gsub(/0x([a-f\d]+)/, "0x01234567")).to eq(str) + expect(hello.ai(:plain => true, :raw => false)).to eq(hello.inspect) + end + + it "without the plain options print the colorized values" do + class Hello + attr_reader :abra + attr_writer :ca + + def initialize + @abra, @ca = 1, 2 + @dabra = 3 + end + end + + hello = Hello.new + out = hello.ai(:raw => true) + str = <<-EOS.strip +# +EOS + expect(out.gsub(/0x([a-f\d]+)/, "0x01234567")).to eq(str) + expect(hello.ai(:plain => true, :raw => false)).to eq(hello.inspect) + end + + it "with multine as false show inline values" do + class Hello + attr_reader :abra + attr_writer :ca + + def initialize + @abra, @ca = 1, 2 + @dabra = 3 + end + end + + hello = Hello.new + out = hello.ai(:multiline => false, :plain => true, :raw => true) + str = <<-EOS.strip +# EOS expect(out.gsub(/0x([a-f\d]+)/, "0x01234567")).to eq(str) expect(hello.ai(:plain => true, :raw => false)).to eq(hello.inspect)