Created
June 29, 2010 12:57
-
-
Save kungfoo/457163 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.join(File.dirname(__FILE__), "..", "spec_helper") | |
require File.join(File.dirname(__FILE__), "fake_document") | |
include Redcar | |
describe AutoIndenter::Analyzer do | |
scala = <<-SCALA | |
package ch.mollusca.stomp.frame | |
import org.scalatest.Spec | |
class FrameProcessorSpec extends Spec { | |
val frameProcessor = new FrameProcessor | |
describe("The frame processor") { | |
it("should handle a complete CONNECT frame") { | |
assert(frame.content === "message body.") | |
} | |
} | |
} | |
SCALA | |
def should_indent(src, options) | |
simple_rules = AutoIndenter::Rules.new( | |
/\{/, | |
/\}/, | |
/^(?!.*;\s*\/\/).*[^\s;{}]\s*$/, | |
/^\s*(\/\/|#).*$/ | |
) | |
analyzer = AutoIndenter::Analyzer.new(simple_rules, FakeDocument.new(source, 2, false), 2, false) | |
analyzer.calculate_for_line(options[:line]).should == options[:indent] | |
end | |
describe "with Scala's real indentation rules loaded" do | |
it "should indent correctly after curly braces" do | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment