Skip to content

Commit

Permalink
Merge branch 'main' into GSOC
Browse files Browse the repository at this point in the history
  • Loading branch information
vidhvath28 authored Sep 3, 2024
2 parents 2f29d56 + 3b49852 commit d562d27
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
1 change: 0 additions & 1 deletion shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ shards:
version_from_shard:
git: https://github.com/hugopl/version_from_shard.git
version: 1.2.5

2 changes: 1 addition & 1 deletion shards.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
rev = "v1.2.5";
sha256 = "0xizj0q4rd541rwjbx04cjifc2gfx4l5v6q2y7gmd0ndjmkgb8ik";
};
}
}
37 changes: 37 additions & 0 deletions spec/repo_spec.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require "./spec_helper"

Spectator.describe Repo do
context "commit" do
let(:with_commit) {
<<-EOF
git: https://github.com/cadmiumcr/transliterator.git
version: 0.1.0+git.commit.46c4c14594057dbcfaf27e7e7c8c164d3f0ce3f1
EOF
}

let(:repo) {
Crystal2Nix::Repo.new(Crystal2Nix::Shard.from_yaml(with_commit))
}

it "should have the commit as revision" do
expect(repo.rev).to eq("46c4c14594057dbcfaf27e7e7c8c164d3f0ce3f1")
end
end

context "explicit version" do
let(:with_version) {
<<-EOF
git: https://github.com/crystal-lang/json_mapping.cr.git
version: 0.1.1
EOF
}

let(:repo) {
Crystal2Nix::Repo.new(Crystal2Nix::Shard.from_yaml(with_version))
}

it "should prefix version references with a v" do
expect(repo.rev).to eq("v0.1.1")
end
end
end
2 changes: 1 addition & 1 deletion src/crystal2nix.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ require "./worker"

module Crystal2Nix
VersionFromShard.declare
end
end
2 changes: 1 addition & 1 deletion src/data.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ module Crystal2Nix
property hg : String?
property version : String
end
end
end
2 changes: 1 addition & 1 deletion src/repo.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ module Crystal2Nix
@url.to_s
end
end
end
end
2 changes: 1 addition & 1 deletion src/worker.cr
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ module Crystal2Nix
puts "Processing completed successfully."
end
end
end
end

0 comments on commit d562d27

Please sign in to comment.