Sha256: 0408976697a78866d350da13f7dd757a477c8c0e22569ebc93270c607c67457a

Contents?: true

Size: 449 Bytes

Versions: 26

Compression:

Stored size: 449 Bytes

Contents

require 'spec_helper'

describe AngularSprinkles::ObjectKeyWrapper do
  let(:wrapper1) { ->(a) { "%%#{a}%%" } }
  let(:wrapper2) { ->(a, b) { "#{a}+#{b}" } }

  let(:arg1) { "a" }
  let(:arg2) { "b" }

  it 'wraps objects on #to_json' do
    json1 = described_class.new(arg1, wrapper1).to_json
    expect(json1).to eq("%%#{arg1}%%")

    json2 = described_class.new(arg1, arg2, wrapper2).to_json
    expect(json2).to eq("#{arg1}+#{arg2}")
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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