File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ schedule :
6+ - cron : " 0 7 * * 1"
7+
8+ jobs :
9+ test :
10+ strategy :
11+ fail-fast : false
12+
13+ runs-on : ubuntu-latest
14+
15+ env :
16+ DB_USER : dbuser
17+ DB_PASSWORD : dbpassword
18+
19+ steps :
20+ - name : Install Crystal
21+ uses : oprypin/install-crystal@v1
22+
23+ - name : Donwload sources
24+ uses : actions/checkout@v2
25+
26+ - name : Check formatting
27+ run : crystal tool format --check
28+
29+ - name : Install dependencies
30+ # TODO: remove --ignore-crystal-version once all packages will be updated
31+ run : shards install --ignore-crystal-version
32+
33+ - name : Run linter
34+ run : ./bin/ameba
35+
36+ - name : Install PostgreSQL
37+ uses : harmon758/postgresql-action@v1
38+ with :
39+ postgresql version : ' 9.5'
40+ postgresql user : ${{ env.DB_USER }}
41+ postgresql password : ${{ env.DB_PASSWORD }}
42+
43+ - name : Run migrations
44+ run : crystal sam.cr db:create @ db:migrate
45+
46+ - name : Run specs
47+ run : make seq
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ require " sam"
2+ require " ./spec/support/config"
3+ require " ./spec/support/models"
4+ require " ./spec/support/migrations/*"
5+
6+ load_dependencies " jennifer"
7+
8+ Sam .help
Original file line number Diff line number Diff line change 11name : factory
2- version : 0.1.4
2+ version : 0.1.5
33
44authors :
55 - Roman Kalnytskyi <moranibaca@gmail.com>
66
7- crystal : 0.26.1
7+ crystal : " >= 0.34.0 "
88
99license : MIT
1010
1111development_dependencies :
1212 minitest :
1313 github : ysbaddaden/minitest.cr
14- version : " ~> 0.4.0"
14+ version : " ~> 1.0.0"
15+ sam :
16+ github : imdrasil/sam.cr
17+ version : " ~> 0.4.1"
1518 jennifer :
1619 github : imdrasil/jennifer.cr
1720 branch : " master"
1821 pg :
1922 github : will/crystal-pg
23+ ameba :
24+ github : crystal-ameba/ameba
25+ version : " = 0.14.3"
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ describe Factory::Jennifer::Base do
44 let(:described_class ) { Factory ::Jennifer ::Base }
55
66 before do
7- ::Jennifer ::Adapter .adapter .begin_transaction
7+ ::Jennifer ::Adapter .default_adapter .begin_transaction
88 end
99
1010 after do
11- ::Jennifer ::Adapter .adapter .rollback_transaction
11+ ::Jennifer ::Adapter .default_adapter .rollback_transaction
1212 end
1313
1414 describe " %association" do
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ require "jennifer"
22require " jennifer/adapter/postgres"
33
44::Jennifer ::Config .configure do |conf |
5- conf.logger.level = Logger ::ERROR
6- conf.host = " localhost"
5+ conf.logger.level = :error
76 conf.adapter = " postgres"
87 conf.migration_files_path = " ./spec/support/migrations"
98 conf.db = " factory_test"
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ class HumanPetFactory < PetFactory
9191 skip_empty_constructor
9292 assign :f1 , " centaur"
9393
94- initialize_with do |hash , traits |
94+ initialize_with do |hash , traits | # ameba:disable Lint/UnusedArgument
9595 obj = described_class.new({" f1" => " some value" })
9696 make_assigns(obj, traits)
9797 obj
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ module Factory
77 {% if factory % }
88 {% klass = factory % }
99 {% else % }
10- {% klass = (name.id.stringify.camelcase + " Factory" ).id % }
10+ {% klass = (name.id.stringify.camelcase + " Factory" ).id % }
1111 {% end % }
1212
1313 def self.__process_association_ {{name.id}}(obj)
Original file line number Diff line number Diff line change @@ -60,15 +60,15 @@ module Factory
6060 {% if ATTRIBUTES .empty? % }
6161 {% if ! IGNORED_METHODS .includes?(" empty_constructor" ) % }
6262 def self._initialize_with (hash, traits)
63- obj = described_class.build
63+ obj = described_class.new
6464 make_assigns(obj, traits)
6565 obj
6666 end
6767 {% end % }
6868 {% else % }
6969 {% if ! IGNORED_METHODS .includes?(" hash_constructor" ) % }
7070 def self._initialize_with (hash, traits)
71- obj = described_class.build (hash)
71+ obj = described_class.new (hash)
7272 make_assigns(obj, traits)
7373 obj
7474 end
You can’t perform that action at this time.
0 commit comments