Sha256: e10d0eb9356479d9da3c340b269f0d9dacf7419ea9a558e53d37ed322178caa3

Contents?: true

Size: 824 Bytes

Versions: 55

Compression:

Stored size: 824 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

55 entries across 55 versions & 1 rubygems

Version Path
volt-0.6.5 spec/models/reactive_tags_spec.rb
volt-0.6.4 spec/models/reactive_tags_spec.rb
volt-0.6.3 spec/models/reactive_tags_spec.rb
volt-0.6.2 spec/models/reactive_tags_spec.rb
volt-0.6.1 spec/models/reactive_tags_spec.rb
volt-0.6.0 spec/models/reactive_tags_spec.rb
volt-0.5.18 spec/models/reactive_tags_spec.rb
volt-0.5.17 spec/models/reactive_tags_spec.rb
volt-0.5.16 spec/models/reactive_tags_spec.rb
volt-0.5.15 spec/models/reactive_tags_spec.rb
volt-0.5.14 spec/models/reactive_tags_spec.rb
volt-0.5.13 spec/models/reactive_tags_spec.rb
volt-0.5.12 spec/models/reactive_tags_spec.rb
volt-0.5.11 spec/models/reactive_tags_spec.rb
volt-0.5.10 spec/models/reactive_tags_spec.rb
volt-0.5.9 spec/models/reactive_tags_spec.rb
volt-0.5.8 spec/models/reactive_tags_spec.rb
volt-0.5.7 spec/models/reactive_tags_spec.rb
volt-0.5.6 spec/models/reactive_tags_spec.rb
volt-0.5.4 spec/models/reactive_tags_spec.rb