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.5.3 spec/models/reactive_tags_spec.rb
volt-0.5.2 spec/models/reactive_tags_spec.rb
volt-0.5.1 spec/models/reactive_tags_spec.rb
volt-0.5.0 spec/models/reactive_tags_spec.rb
volt-0.4.18 spec/models/reactive_tags_spec.rb
volt-0.4.17 spec/models/reactive_tags_spec.rb
volt-0.4.15 spec/models/reactive_tags_spec.rb
volt-0.4.14 spec/models/reactive_tags_spec.rb
volt-0.4.12 spec/models/reactive_tags_spec.rb
volt-0.4.11 spec/models/reactive_tags_spec.rb
volt-0.4.10 spec/models/reactive_tags_spec.rb
volt-0.4.9 spec/models/reactive_tags_spec.rb
volt-0.4.8 spec/models/reactive_tags_spec.rb
volt-0.4.7 spec/models/reactive_tags_spec.rb
volt-0.4.5 spec/models/reactive_tags_spec.rb
volt-0.4.4 spec/models/reactive_tags_spec.rb
volt-0.4.3 spec/models/reactive_tags_spec.rb
volt-0.4.2 spec/models/reactive_tags_spec.rb
volt-0.4.1 spec/models/reactive_tags_spec.rb
volt-0.4.0 spec/models/reactive_tags_spec.rb