Sha256: f752e45b75168b2828d0138f9e29dc1eb5b194258118731b6b51b2b06a3fc8e9

Contents?: true

Size: 866 Bytes

Versions: 4

Compression:

Stored size: 866 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper.rb'
require 'tailor/file_line'

include Tailor

describe Tailor::FileLine, "spacing around parentheses" do
  context "in a method" do
    it "should be OK with no space before ) and none after (" do
      line = create_file_line "  def do_something(that, this)", __LINE__
      line.spacing_problems.should == 0
    end

    it "should be OK with no parameters" do
      line = create_file_line "  def do_something()", __LINE__
      line.spacing_problems.should == 0
    end

    it "should detect a space after (" do
      line = create_file_line "  def do_something( that, this)", __LINE__
      line.spacing_problems.should == 1
    end

    it "should detect a space before )" do
      line = create_file_line "  def do_something(that, this )", __LINE__
      line.spacing_problems.should == 1
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tailor-0.1.3 spec/spacing/parentheses_spacing_spec.rb
tailor-0.1.2 spec/spacing/parentheses_spacing_spec.rb
tailor-0.1.1 spec/spacing/parentheses_spacing_spec.rb
tailor-0.1.0 spec/spacing/parentheses_spacing_spec.rb