Sha256: 62f320775bb3b62c30aedd3ae4244e68af7a2c69189b347837b3181461dbfcfc

Contents?: true

Size: 815 Bytes

Versions: 23

Compression:

Stored size: 815 Bytes

Contents

require 'volt/models'

class TestCustomClass
  include ReactiveTags

  tag_method(:cool) do
    destructive!
  end
end

class TestSubClass < TestCustomClass

end

class TestInherit < TestCustomClass
  tag_method(:cool) do
    pass_reactive!
  end
end

describe ReactiveTags do
  it "should tag correctly" do
    expect(TestCustomClass.new.reactive_method_tag(:cool, :destructive)).to eq(true)
  end

  it "should include tags in a subclass" do
    expect(TestSubClass.new.reactive_method_tag(:cool, :destructive)).to eq(true)
    expect(TestSubClass.new.reactive_method_tag(:cool, :pass_reactive)).to eq(nil)
  end

  it "should inherit" do
    expect(TestInherit.new.reactive_method_tag(:cool, :destructive)).to eq(true)
    expect(TestInherit.new.reactive_method_tag(:cool, :pass_reactive)).to eq(true)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
volt-0.7.23 spec/models/reactive_tags_spec.rb
volt-0.7.22 spec/models/reactive_tags_spec.rb
volt-0.7.21 spec/models/reactive_tags_spec.rb
volt-0.7.20 spec/models/reactive_tags_spec.rb
volt-0.7.19 spec/models/reactive_tags_spec.rb
volt-0.7.18 spec/models/reactive_tags_spec.rb
volt-0.7.17 spec/models/reactive_tags_spec.rb
volt-0.7.16 spec/models/reactive_tags_spec.rb
volt-0.7.15 spec/models/reactive_tags_spec.rb
volt-0.7.14 spec/models/reactive_tags_spec.rb
volt-0.7.13 spec/models/reactive_tags_spec.rb
volt-0.7.12 spec/models/reactive_tags_spec.rb
volt-0.7.10 spec/models/reactive_tags_spec.rb
volt-0.7.9 spec/models/reactive_tags_spec.rb
volt-0.7.8 spec/models/reactive_tags_spec.rb
volt-0.7.7 spec/models/reactive_tags_spec.rb
volt-0.7.6 spec/models/reactive_tags_spec.rb
volt-0.7.5 spec/models/reactive_tags_spec.rb
volt-0.7.4 spec/models/reactive_tags_spec.rb
volt-0.7.3 spec/models/reactive_tags_spec.rb