Skip to content

Commit

Permalink
Ruby 2.4 unifies Fixnum and Bignum into Integer
Browse files Browse the repository at this point in the history
For now, make the test expectations different for ruby 2.4.0+ vs. prior rubies.

CustomAttribute#value_type returns a symbol for a ruby core class, a
hardcoded value instead of the class's behavior.
Do we use this?  Why are we returning a value instead of caring about
behavior of the old Fixnum and Integer?  If we don't use this, we
should remove the whole method and it's tests added in:
4687394

The PR that added this was:
#11000

Adding CustomAttribute to provider UI/API was added in:
#10897
  • Loading branch information
jrafanie committed May 1, 2017
1 parent ff9b467 commit 56f5fc9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/models/custom_attribute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
end

it "returns the value type of Fixnum custom attributes" do
expect(int_custom_attribute.value_type).to eq(:fixnum)
# TODO: Ruby 2.4 unifies fixnum and bignum into integer, we shouldn't be
# returnings ruby types like this.
expected = RUBY_VERSION >= "2.4.0" ? :integer : :fixnum
expect(int_custom_attribute.value_type).to eq(expected)
end
end

0 comments on commit 56f5fc9

Please sign in to comment.