Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions spec/gemnasium/parser/gemfile_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require "spec_helper"

describe Gemnasium::Parser::Gemfile do

def undent(string)
first_line_indent = string[/\A\s*/]
string.gsub(/^#{first_line_indent}/, "")
end

def content(string)
@content ||= begin
indent = string.scan(/^[ \t]*(?=\S)/)
n = indent ? indent.size : 0
string.gsub(/^[ \t]{#{n}}/, "")
end
@content ||= undent(string)
end

def gemfile
Expand Down