Sha256: 60792541f7e07cacd8d2f35b81739acc5d4372f31d1e787aae14e7f80d6a92b9

Contents?: true

Size: 484 Bytes

Versions: 21

Compression:

Stored size: 484 Bytes

Contents

require 'spec_helper'

describe AngularSprinkles::ConstructorCollection do
  let(:json_wrapper) { ->{} }
  let(:stub) { "stub" }
  let(:object_wrapper) { double(new: stub) }

  subject { described_class.new(json_wrapper: json_wrapper, object_wrapper: object_wrapper) }

  it 'turns objects into a wrapped js string' do
    # add two items to the collection
    subject.push(1, 2)
    subject.push(1, 2)

    expect(subject.to_json).to eq("#{stub.to_json}\n#{stub.to_json}")
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
angular_sprinkles-0.3.3 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.3.2 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.3.1 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.3.0 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.14 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.13 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.12 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.11 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.10 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.9 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.8 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.7 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.6 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.5 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.4 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.3 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.2 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.1 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.2.0 spec/angular_sprinkles/constructor_collection_spec.rb
angular_sprinkles-0.1.1 spec/angular_sprinkles/constructor_collection_spec.rb