Sha256: a63034be07c77114318ad8ca98c9ddfd2a83b95a0974f8c9198170076a65fab7

Contents?: true

Size: 908 Bytes

Versions: 3

Compression:

Stored size: 908 Bytes

Contents

require 'spec_helper'

describe AngularSprinkles::Mixins::Initializable do
  class StubClass
    include AngularSprinkles::Mixins::Initializable
  end

  let(:stub_class) { StubClass.new }

  describe '#app_initialized?' do
    it 'returns false the first time and true after that' do
      expect(stub_class.app_initialized?).to eq(false)
      expect(stub_class.app_initialized?).to eq(true)
      expect(stub_class.app_initialized?).to eq(true)
    end
  end

  describe '#var_initialized?' do
    it 'returns false the first time and true after that' do
      var = 'a.b'

      expect(stub_class.var_initialized?(var)).to eq(false)
      expect(stub_class.var_initialized?(var)).to eq(true)
      expect(stub_class.var_initialized?(var)).to eq(true)

      expect(stub_class.var_initialized?(var + '.c')).to eq(false)
      expect(stub_class.var_initialized?(var + '.c')).to eq(true)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
angular_sprinkles-0.0.3 spec/mixins/initializable_spec.rb
angular_sprinkles-0.0.2 spec/mixins/initializable_spec.rb
angular_sprinkles-0.0.1 spec/mixins/initializable_spec.rb