Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a9679130e11d
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f021f1ff0e36
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 15, 2016

  1. Small refactor in spec

    Ary Borenszweig committed Sep 15, 2016
    Copy the full SHA
    570d0f9 View commit details
  2. Spec: allow passing directories. Fixes #3312

    Ary Borenszweig committed Sep 15, 2016
    Copy the full SHA
    f021f1f View commit details
Showing with 5 additions and 4 deletions.
  1. +1 −2 spec/std/io/memory_io_spec.cr
  2. +4 −2 src/compiler/crystal/command/spec.cr
3 changes: 1 addition & 2 deletions spec/std/io/memory_io_spec.cr
Original file line number Diff line number Diff line change
@@ -29,9 +29,8 @@ describe "MemoryIO" do
it "raises if reading when closed" do
io = MemoryIO.new("abc")
io.close
buffer = uninitialized UInt8[3]
expect_raises(IO::Error, "closed stream") do
io.read(buffer.to_slice)
io.read(Slice.new(3, 0_u8))
end
end

6 changes: 4 additions & 2 deletions src/compiler/crystal/command/spec.cr
Original file line number Diff line number Diff line change
@@ -33,8 +33,10 @@ class Crystal::Command
end

# Assume spec files end with ".cr" and optionally with a colon and a number
# (for the target line number). Everything else is an option we forward.
filenames = options.select { |option| option =~ /\.cr(\:\d+)?\Z/ }
# (for the target line number), or is a directory. Everything else is an option we forward.
filenames = options.select do |option|
option =~ /\.cr(\:\d+)?\Z/ || Dir.exists?(option)
end
options.reject! { |option| filenames.includes?(option) }

locations = [] of {String, String}