Class: ViewSpec::Spec
- Inherits:
-
DSL::Context
- Object
- DSL::Context
- ViewSpec::Spec
- Includes:
- DSL::Controller, DSL::Groups, DSL::Layout, DSL::Scenarios, DSL::Title
- Defined in:
- lib/view_spec/spec.rb
Instance Attribute Summary collapse
-
#source_file ⇒ Object
readonly
Returns the value of attribute source_file.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(source_file, subject, &block) ⇒ Spec
constructor
A new instance of Spec.
- #lookup_path ⇒ Object
- #short_identifier ⇒ Object
- #to_param ⇒ Object
- #to_partial_path ⇒ Object
Methods included from DSL::Controller
Methods included from DSL::Scenarios
Methods included from DSL::Groups
Methods included from DSL::Layout
Methods included from DSL::Title
Methods inherited from DSL::Context
#entries, lookup_attr, lookup_attrs, type
Constructor Details
#initialize(source_file, subject, &block) ⇒ Spec
Returns a new instance of Spec.
11 12 13 14 15 |
# File 'lib/view_spec/spec.rb', line 11 def initialize(source_file, subject, &block) @source_file = source_file super(subject, nil, &block) end |
Instance Attribute Details
#source_file ⇒ Object (readonly)
Returns the value of attribute source_file.
9 10 11 |
# File 'lib/view_spec/spec.rb', line 9 def source_file @source_file end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
9 10 11 |
# File 'lib/view_spec/spec.rb', line 9 def subject @subject end |
Instance Method Details
#lookup_path ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/view_spec/spec.rb', line 21 def lookup_path if @source_file.spec_file? @source_file.lookup_path else short_identifier end end |
#short_identifier ⇒ Object
17 18 19 |
# File 'lib/view_spec/spec.rb', line 17 def short_identifier @subject.to_short_identifier end |
#to_param ⇒ Object
29 30 31 |
# File 'lib/view_spec/spec.rb', line 29 def to_param lookup_path end |
#to_partial_path ⇒ Object
33 34 35 |
# File 'lib/view_spec/spec.rb', line 33 def to_partial_path "view_spec/spec" end |