Class: CucumberFM::Feature

Inherits:
Struct
  • Object
show all
Includes:
CucumberFM::FeatureElement::Component::TotalEstimation
Defined in:
lib/cucumber_f_m/feature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CucumberFM::FeatureElement::Component::TotalEstimation

#estimation, #estimation_done, #estimation_done_percentage, #scenarios_done, #scenarios_done_percentage

Instance Attribute Details

#cfmObject

Returns the value of attribute cfm

Returns:

  • (Object)

    the current value of cfm



2
3
4
# File 'lib/cucumber_f_m/feature.rb', line 2

def cfm
  @cfm
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



2
3
4
# File 'lib/cucumber_f_m/feature.rb', line 2

def path
  @path
end

Instance Method Details

#<=>(_f) ⇒ Object



63
64
65
# File 'lib/cucumber_f_m/feature.rb', line 63

def <=>(_f)
  info.title <=> _f.info.title
end

#backgroundObject



26
27
28
# File 'lib/cucumber_f_m/feature.rb', line 26

def background
  @background ||= FeatureElement::Background.new(self, scan_for_background_from_raw)
end

#destroyObject



49
50
51
52
53
# File 'lib/cucumber_f_m/feature.rb', line 49

def destroy
  File.delete(path)
  remove_file_from_repo
  push
end

#filenameObject



55
56
57
# File 'lib/cucumber_f_m/feature.rb', line 55

def filename
  File.basename(path)
end

#filename_without_extensionObject



59
60
61
# File 'lib/cucumber_f_m/feature.rb', line 59

def filename_without_extension
  File.basename(path, '.feature')
end

#idObject



6
7
8
# File 'lib/cucumber_f_m/feature.rb', line 6

def id
  Base64.encode64(relative_path)
end

#infoObject



22
23
24
# File 'lib/cucumber_f_m/feature.rb', line 22

def info
  @info ||= FeatureElement::Info.new(self, scan_for_feature_info_from_raw)
end

#rawObject



14
15
16
# File 'lib/cucumber_f_m/feature.rb', line 14

def raw
  @raw ||= read_content_from_file
end

#raw=(content) ⇒ Object



18
19
20
# File 'lib/cucumber_f_m/feature.rb', line 18

def raw= content
  @raw = content
end

#relative_pathObject



10
11
12
# File 'lib/cucumber_f_m/feature.rb', line 10

def relative_path
  path.gsub(/^#{cfm.path}\//, '')
end

#saveObject



42
43
44
45
46
47
# File 'lib/cucumber_f_m/feature.rb', line 42

def save
  write_content_to_file
  commit
  push
  true
end

#scenariosObject



30
31
32
# File 'lib/cucumber_f_m/feature.rb', line 30

def scenarios
  @scenarios ||= fetch_scenarios
end

#tagsObject



34
35
36
# File 'lib/cucumber_f_m/feature.rb', line 34

def tags
  info.tags
end

#tags_allObject



38
39
40
# File 'lib/cucumber_f_m/feature.rb', line 38

def tags_all
  scenarios.collect{|scenario| scenario.tags }.flatten.uniq
end