Class: Richcss::TestSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/richcss/richcss_test_specification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ TestSpecification

Returns a new instance of TestSpecification.



4
5
6
7
8
9
10
# File 'lib/richcss/richcss_test_specification.rb', line 4

def initialize(hash)
  self.name = hash['name']
  self.version = VersionKit::Version.new(hash['version'])
  self.dependencies = hash['dependencies'].map do |(name, requirement)|
    VersionKit::Dependency.new(name, requirement.split(',').map(&:chomp))
  end
end

Instance Attribute Details

#dependenciesObject

Returns the value of attribute dependencies.



3
4
5
# File 'lib/richcss/richcss_test_specification.rb', line 3

def dependencies
  @dependencies
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/richcss/richcss_test_specification.rb', line 3

def name
  @name
end

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/richcss/richcss_test_specification.rb', line 3

def version
  @version
end

Instance Method Details

#==(other) ⇒ Object



12
13
14
15
16
# File 'lib/richcss/richcss_test_specification.rb', line 12

def ==(other)
  name == other.name &&
    version == other.version &&
    dependencies == other.dependencies
end

#to_sObject



18
19
20
# File 'lib/richcss/richcss_test_specification.rb', line 18

def to_s
  "#{name} (#{version})"
end