Class: Specter::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/specter/application/app/models/specter/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pathname) ⇒ Test

Returns a new instance of Test.



4
5
6
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 4

def initialize(pathname)
  @pathname = pathname
end

Instance Attribute Details

#pathnameObject (readonly)

Returns the value of attribute pathname.



3
4
5
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 3

def pathname
  @pathname
end

Instance Method Details

#expectedObject



12
13
14
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 12

def expected
  File.open(@pathname + "expected.html").read
end

#inputObject



8
9
10
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 8

def input
  File.open(@pathname + "input.html").read
end

#testObject



16
17
18
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 16

def test
  File.open(@pathname + "test.js").read
end

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 20

def valid?
  File.exist?(@pathname + "input.html") &&
  File.exist?(@pathname + "expected.html") &&
  File.exist?(@pathname + "test.js")
end