Skip to content

Commit

Permalink
Merge pull request #568 from ftnk/simplify_content_as_json
Browse files Browse the repository at this point in the history
[Refactoring] Simplify Serverspec::Type::File#content_as_json with #content
  • Loading branch information
mizzy committed May 15, 2016
2 parents 30dbe41 + 0fe8c2d commit 5404e89
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/serverspec/type/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ def content
end

def content_as_json
if @content_as_json.nil?
@content = @runner.get_file_content(@name).stdout if @content.nil?
@content_as_json = MultiJson.load(@content)
end
@content_as_json = MultiJson.load(content) if @content_as_json.nil?
@content_as_json
end

Expand Down

0 comments on commit 5404e89

Please sign in to comment.