mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
remove references to older rubies
This commit is contained in:
parent
da29f748f2
commit
52933a1c74
1 changed files with 13 additions and 67 deletions
|
@ -21,11 +21,7 @@ RSpec.describe 'AwesomePrint/ActiveRecord', skip: -> { !ExtVerifier.has_rails? }
|
||||||
:rank => 1
|
:rank => 1
|
||||||
}
|
}
|
||||||
EOS
|
EOS
|
||||||
if RUBY_VERSION < '1.9'
|
str.sub!('?', '1992-10-10 12:30:00 UTC')
|
||||||
str.sub!('?', 'Sat Oct 10 12:30:00 UTC 1992')
|
|
||||||
else
|
|
||||||
str.sub!('?', '1992-10-10 12:30:00 UTC')
|
|
||||||
end
|
|
||||||
expect(out).to be_similar_to(str)
|
expect(out).to be_similar_to(str)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -49,13 +45,8 @@ RSpec.describe 'AwesomePrint/ActiveRecord', skip: -> { !ExtVerifier.has_rails? }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
EOS
|
EOS
|
||||||
if RUBY_VERSION < '1.9'
|
str.sub!('??', '1992-10-10 12:30:00 UTC')
|
||||||
str.sub!('??', 'Sat Oct 10 12:30:00 UTC 1992')
|
str.sub!('?!', '2003-05-26 14:15:00 UTC')
|
||||||
str.sub!('?!', 'Mon May 26 14:15:00 UTC 2003')
|
|
||||||
else
|
|
||||||
str.sub!('??', '1992-10-10 12:30:00 UTC')
|
|
||||||
str.sub!('?!', '2003-05-26 14:15:00 UTC')
|
|
||||||
end
|
|
||||||
expect(out).to be_similar_to(str)
|
expect(out).to be_similar_to(str)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -81,13 +72,8 @@ RSpec.describe 'AwesomePrint/ActiveRecord', skip: -> { !ExtVerifier.has_rails? }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
EOS
|
EOS
|
||||||
if RUBY_VERSION < '1.9'
|
str.sub!('??', '1992-10-10 12:30:00 UTC')
|
||||||
str.sub!('??', 'Sat Oct 10 12:30:00 UTC 1992')
|
str.sub!('?!', '2003-05-26 14:15:00 UTC')
|
||||||
str.sub!('?!', 'Mon May 26 14:15:00 UTC 2003')
|
|
||||||
else
|
|
||||||
str.sub!('??', '1992-10-10 12:30:00 UTC')
|
|
||||||
str.sub!('?!', '2003-05-26 14:15:00 UTC')
|
|
||||||
end
|
|
||||||
expect(out).to be_similar_to(str)
|
expect(out).to be_similar_to(str)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -132,22 +118,6 @@ EOS
|
||||||
ActiveRecordData.raw_5_1_diana
|
ActiveRecordData.raw_5_1_diana
|
||||||
elsif activerecord_5_0?
|
elsif activerecord_5_0?
|
||||||
ActiveRecordData.raw_5_0_diana
|
ActiveRecordData.raw_5_0_diana
|
||||||
elsif activerecord_4_2?
|
|
||||||
if RUBY_VERSION > '1.9.3'
|
|
||||||
ActiveRecordData.raw_4_2_diana
|
|
||||||
else
|
|
||||||
ActiveRecordData.raw_4_2_diana_legacy
|
|
||||||
end
|
|
||||||
elsif activerecord_4_1?
|
|
||||||
ActiveRecordData.raw_4_1_diana
|
|
||||||
elsif activerecord_4_0?
|
|
||||||
ActiveRecordData.raw_4_0_diana
|
|
||||||
elsif activerecord_3_2?
|
|
||||||
if RUBY_VERSION > '1.9.3'
|
|
||||||
ActiveRecordData.raw_3_2_diana
|
|
||||||
else
|
|
||||||
ActiveRecordData.raw_3_2_diana_legacy
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
raw_object_string.sub!('?', '1992-10-10 12:30:00')
|
raw_object_string.sub!('?', '1992-10-10 12:30:00')
|
||||||
expect(out).to be_similar_to(raw_object_string)
|
expect(out).to be_similar_to(raw_object_string)
|
||||||
|
@ -163,25 +133,10 @@ EOS
|
||||||
ActiveRecordData.raw_5_1_multi
|
ActiveRecordData.raw_5_1_multi
|
||||||
elsif activerecord_5_0?
|
elsif activerecord_5_0?
|
||||||
ActiveRecordData.raw_5_0_multi
|
ActiveRecordData.raw_5_0_multi
|
||||||
elsif activerecord_4_2?
|
|
||||||
if RUBY_VERSION > '1.9.3'
|
|
||||||
ActiveRecordData.raw_4_2_multi
|
|
||||||
else
|
|
||||||
ActiveRecordData.raw_4_2_multi_legacy
|
|
||||||
end
|
|
||||||
elsif activerecord_4_1?
|
|
||||||
ActiveRecordData.raw_4_1_multi
|
|
||||||
elsif activerecord_4_0?
|
|
||||||
ActiveRecordData.raw_4_0_multi
|
|
||||||
elsif activerecord_3_2?
|
|
||||||
if RUBY_VERSION > '1.9.3'
|
|
||||||
ActiveRecordData.raw_3_2_multi
|
|
||||||
else
|
|
||||||
ActiveRecordData.raw_3_2_multi_legacy
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
raw_object_string.sub!('?', '1992-10-10 12:30:00')
|
raw_object_string.sub!('?', '1992-10-10 12:30:00')
|
||||||
raw_object_string.sub!('?', '2003-05-26 14:15:00')
|
raw_object_string.sub!('?', '2003-05-26 14:15:00')
|
||||||
|
|
||||||
expect(out).to be_similar_to(raw_object_string)
|
expect(out).to be_similar_to(raw_object_string)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -232,20 +187,15 @@ class SubUser < User {
|
||||||
# spec 1
|
# spec 1
|
||||||
out = @ap.awesome(User.methods.grep(/first/))
|
out = @ap.awesome(User.methods.grep(/first/))
|
||||||
|
|
||||||
if ActiveRecord::VERSION::STRING >= '3.2'
|
if RUBY_VERSION >= '2.4.4'
|
||||||
if RUBY_VERSION >= '2.4.4'
|
expect(out).to match(/\sfirst\(\*arg.*?\)\s+User/)
|
||||||
expect(out).to match(/\sfirst\(\*arg.*?\)\s+User/)
|
|
||||||
elsif RUBY_VERSION >= '1.9'
|
|
||||||
expect(out).to match(/\sfirst\(\*args,\s&block\)\s+Class \(ActiveRecord::Querying\)/)
|
|
||||||
else
|
|
||||||
expect(out).to match(/\sfirst\(\*arg1\)\s+Class \(ActiveRecord::Querying\)/)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
expect(out).to match(/\sfirst\(\*arg.*?\)\s+User \(ActiveRecord::Base\)/)
|
expect(out).to match(/\sfirst\(\*args,\s&block\)\s+Class \(ActiveRecord::Querying\)/)
|
||||||
end
|
end
|
||||||
|
|
||||||
# spec 2
|
# spec 2
|
||||||
out = @ap.awesome(User.methods.grep(/primary_key/))
|
out = @ap.awesome(User.methods.grep(/primary_key/))
|
||||||
|
|
||||||
if RUBY_VERSION >= '2.4.4'
|
if RUBY_VERSION >= '2.4.4'
|
||||||
expect(out).to match(/\sprimary_key\(.*?\)\s+User/)
|
expect(out).to match(/\sprimary_key\(.*?\)\s+User/)
|
||||||
else
|
else
|
||||||
|
@ -255,14 +205,10 @@ class SubUser < User {
|
||||||
# spec 3
|
# spec 3
|
||||||
out = @ap.awesome(User.methods.grep(/validate/))
|
out = @ap.awesome(User.methods.grep(/validate/))
|
||||||
|
|
||||||
if ActiveRecord::VERSION::MAJOR < 3
|
if RUBY_VERSION >= '2.4.4'
|
||||||
expect(out).to match(/\svalidate\(\*arg.*?\)\s+User \(ActiveRecord::Base\)/)
|
expect(out).to match(/\svalidate\(\*arg.*?\)\s+User/)
|
||||||
else
|
else
|
||||||
if RUBY_VERSION >= '2.4.4'
|
expect(out).to match(/\svalidate\(\*arg.*?\)\s+Class \(ActiveModel::Validations::ClassMethods\)/)
|
||||||
expect(out).to match(/\svalidate\(\*arg.*?\)\s+User/)
|
|
||||||
else
|
|
||||||
expect(out).to match(/\svalidate\(\*arg.*?\)\s+Class \(ActiveModel::Validations::ClassMethods\)/)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue