Sha256: 91159a6261eacdab066df8050734ac14993e6e84f8fbbf09d65239ecde4e5ecf
Contents?: true
Size: 844 Bytes
Versions: 3
Compression:
Stored size: 844 Bytes
Contents
require 'spec_helper' describe SonJay::ValueArray do it "is array-like" do expect( subject.to_ary ).to eq( subject ) expect( subject << 1 << 2 ).to eq( [1, 2] ) end describe '#sonj_content' do it "returns the instance itself" do expect( subject.sonj_content ).to eq( subject ) end end describe '#load_data' do it "replaces content with given array" do subject << 1 expect( subject.length ).to eq( 1 ) subject.load_data( [7, 8, 9] ) expect( subject.entries ).to eq( [7, 8, 9] ) end end describe '#to_json' do it "returns a JSON representation of the array w/ values" do subject.replace( [1, 2, 'three'] ) actual_json = subject.to_json parsed_json = JSON.parse( actual_json ) expect( parsed_json ).to eq( [1, 2, 'three'] ) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
son_jay-0.4.1 | spec/value_array_spec.rb |
son_jay-0.4.0 | spec/value_array_spec.rb |
son_jay-0.3.0 | spec/value_array_spec.rb |