File: spec_helper.rb

package info (click to toggle)
ruby-attr-required 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: ruby: 290; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#require 'simplecov'

#SimpleCov.start do
  #add_filter 'spec'
#end

require 'attr_required'
require 'attr_optional'
require 'rspec'

class A
  include AttrRequired, AttrOptional
  attr_required :attr_required_a
  attr_optional :attr_optional_a
end

class B < A
  attr_required :attr_required_b
  attr_optional :attr_optional_b
end

class C < B
  undef_required_attributes :attr_required_a
  undef_optional_attributes :attr_optional_a
  attr_optional :attr_required_b
  attr_required :attr_optional_b
end

class OnlyRequired
  include AttrRequired
  attr_required :only_required
end

class OnlyOptional
  include AttrOptional
  attr_optional :only_optional
end