Sha256: 469969cb11c70e3450c12641cc16fafdd486f636a7ff7731e887a7beb45722cb

Contents?: true

Size: 451 Bytes

Versions: 2

Compression:

Stored size: 451 Bytes

Contents

require 'spec_helper'

describe RailsSettingsUi::ValueTypes::Fixnum do
  describe "#cast" do
    it "should cast to integer" do
      fixnum_type = RailsSettingsUi::ValueTypes::Fixnum.new("29")
      expect(fixnum_type.cast).to eq(29)
    end
  end

  describe "if value not numeric" do
    it "should be not valid" do
      fixnum_type = RailsSettingsUi::ValueTypes::Fixnum.new("qwerty")
      expect(fixnum_type.valid?).to be_false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails-settings-ui-0.1.1 spec/lib/rails-settings-ui/value_types/fixnum_spec.rb
rails-settings-ui-0.1.0 spec/lib/rails-settings-ui/value_types/fixnum_spec.rb