File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 571
571
572
572
context 'when storing BigDecimal as decimal128' do
573
573
config_override :map_big_decimal_to_decimal128 , true
574
+ min_bson_version '4.15.0'
574
575
575
576
it "returns the non-demongoized distinct field values" do
576
- pending 'RUBY-2928'
577
-
578
577
expect ( context . distinct ( :sales ) . sort ) . to eq ( [ BSON ::Decimal128 . new ( "1E2" ) , BSON ::Decimal128 . new ( "2E3" ) ] )
579
578
end
580
579
end
Original file line number Diff line number Diff line change @@ -27,6 +27,30 @@ def driver_version(precision)
27
27
Mongo ::VERSION . split ( '.' ) [ 0 ...precision ] . map ( &:to_i )
28
28
end
29
29
30
+ def min_bson_version ( version )
31
+ required_version = version . split ( '.' ) . map ( &:to_i )
32
+ actual_version = bson_version ( required_version . length )
33
+ before ( :all ) do
34
+ if ( actual_version <=> required_version ) < 0
35
+ skip "bson-ruby version #{ version } or higher is required"
36
+ end
37
+ end
38
+ end
39
+
40
+ def max_bson_version ( version )
41
+ required_version = version . split ( '.' ) . map ( &:to_i )
42
+ actual_version = bson_version ( required_version . length )
43
+ before ( :all ) do
44
+ if ( actual_version <=> required_version ) > 0
45
+ skip "bson-ruby version #{ version } or lower is required"
46
+ end
47
+ end
48
+ end
49
+
50
+ def bson_version ( precision )
51
+ BSON ::VERSION . split ( '.' ) [ 0 ...precision ] . map ( &:to_i )
52
+ end
53
+
30
54
def min_rails_version ( version )
31
55
unless version =~ /\A \d +\. \d +\z /
32
56
raise ArgumentError , "Version can only be major.minor: #{ version } "
You can’t perform that action at this time.
0 commit comments