Class: Specter::Test
- Inherits:
-
Object
- Object
- Specter::Test
- Defined in:
- lib/rails/specter/application/app/models/specter/test.rb
Instance Attribute Summary collapse
-
#pathname ⇒ Object
readonly
Returns the value of attribute pathname.
Instance Method Summary collapse
- #expected ⇒ Object
-
#initialize(pathname) ⇒ Test
constructor
A new instance of Test.
- #input ⇒ Object
- #test ⇒ Object
- #valid? ⇒ Boolean
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
#pathname ⇒ Object (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
#expected ⇒ Object
12 13 14 |
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 12 def expected File.open(@pathname + "expected.html").read end |
#input ⇒ Object
8 9 10 |
# File 'lib/rails/specter/application/app/models/specter/test.rb', line 8 def input File.open(@pathname + "input.html").read end |
#test ⇒ Object
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
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 |