Sha256: 411d4a9232488b149234bb5937b87a516963b7db8dc8148d0f1e311ea8984387

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

require_relative '../spec_helper'
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

2 entries across 2 versions & 1 rubygems

Version Path
tailor-0.1.5 spec/spacing/parentheses_spacing_spec.rb
tailor-0.1.4 spec/spacing/parentheses_spacing_spec.rb