pattern_generator 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/poro/poro_generator.rb +24 -0
- data/lib/generators/poro/templates/poro.rb +5 -0
- data/lib/generators/poro/templates/poro_spec.rb +9 -0
- data/lib/generators/poro/templates/poro_test.rb +7 -0
- data/lib/pattern_generator/version.rb +1 -1
- data/test/dummy/log/test.log +388 -0
- data/test/generators/poro_generator_test.rb +40 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f31e64304aff265da3f913a37f2ba398f7acbc8
|
4
|
+
data.tar.gz: b4f3f2b2f47773de048fa446e0381b2d49988a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91e0e7d0d054503c2cba164b143b452d7d582e822cc7ff42572448fe67260983e5d9f998cf087a6fd1a74af08f976753ecac9de1ba24cd0482e14b5eb86de64b
|
7
|
+
data.tar.gz: 01465dfb7cfca05030240788a2fabb14eeb7c143da6d7743b873883a4697b9ac05c2cd0e91beaf59af325930ff8d3d6789e340cd86d97659a021ed448c5a8994
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'active_support/inflector'
|
2
|
+
|
3
|
+
class PoroGenerator < Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
class_option :test_suite, type: :string, default: 'rspec', desc: 'Test framework to generate test. (rspec or minitest)'
|
6
|
+
|
7
|
+
def generate_template
|
8
|
+
template 'poro.rb', "app/models/#{file_name}.rb"
|
9
|
+
end
|
10
|
+
|
11
|
+
def generate_test
|
12
|
+
if options.test_suite == 'rspec'
|
13
|
+
template 'poro_spec.rb', "spec/models/#{file_name}_spec.rb"
|
14
|
+
elsif options.test_suite == 'minitest'
|
15
|
+
template 'poro_test.rb', "test/models/#{file_name}_test.rb"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def class_name
|
22
|
+
file_name.classify
|
23
|
+
end
|
24
|
+
end
|
data/test/dummy/log/test.log
CHANGED
@@ -1717,3 +1717,391 @@ PolicyGeneratorTest: test_rspec_file_is_generated
|
|
1717
1717
|
PolicyGeneratorTest: test_correct_file_is_generated
|
1718
1718
|
---------------------------------------------------
|
1719
1719
|
[1m[35m (0.2ms)[0m rollback transaction
|
1720
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1721
|
+
[1m[36m (1.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1722
|
+
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
1723
|
+
[1m[36m (1.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1724
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1725
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1726
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1727
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1728
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1729
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1730
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1731
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1732
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1733
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1734
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1735
|
+
---------------------------------------------------
|
1736
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
1737
|
+
---------------------------------------------------
|
1738
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1739
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1740
|
+
-------------------------------------------------
|
1741
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
1742
|
+
-------------------------------------------------
|
1743
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1744
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1745
|
+
------------------------------------------------------------------------------
|
1746
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
1747
|
+
------------------------------------------------------------------------------
|
1748
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1749
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1750
|
+
-------------------------------------------------
|
1751
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
1752
|
+
-------------------------------------------------
|
1753
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1754
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1755
|
+
----------------------------------------------------
|
1756
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
1757
|
+
----------------------------------------------------
|
1758
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1759
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1760
|
+
---------------------------------------------------------
|
1761
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
1762
|
+
---------------------------------------------------------
|
1763
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1764
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1765
|
+
--------------------------------------------------------------------------------
|
1766
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
1767
|
+
--------------------------------------------------------------------------------
|
1768
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1769
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1770
|
+
[1m[36m (3.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1771
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1772
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1773
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1774
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1775
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1776
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1777
|
+
-------------------------------------------------
|
1778
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
1779
|
+
-------------------------------------------------
|
1780
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1781
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1782
|
+
------------------------------------------------------------------------------
|
1783
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
1784
|
+
------------------------------------------------------------------------------
|
1785
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1786
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1787
|
+
---------------------------------------------------
|
1788
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
1789
|
+
---------------------------------------------------
|
1790
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1791
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1792
|
+
-------------------------------------------------
|
1793
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
1794
|
+
-------------------------------------------------
|
1795
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1796
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1797
|
+
----------------------------------------------------
|
1798
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
1799
|
+
----------------------------------------------------
|
1800
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1801
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
1802
|
+
--------------------------------------------------------------------------------
|
1803
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
1804
|
+
--------------------------------------------------------------------------------
|
1805
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1806
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1807
|
+
---------------------------------------------------------
|
1808
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
1809
|
+
---------------------------------------------------------
|
1810
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1811
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1812
|
+
[1m[36m (2.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1813
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1814
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1815
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1816
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1817
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1818
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1819
|
+
-------------------------------------------------
|
1820
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
1821
|
+
-------------------------------------------------
|
1822
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1823
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1824
|
+
-----------------------------------------------
|
1825
|
+
PoroGeneratorTest: test_rspec_test_is_generated
|
1826
|
+
-----------------------------------------------
|
1827
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1828
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1829
|
+
----------------------------------------------------
|
1830
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
1831
|
+
----------------------------------------------------
|
1832
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1833
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1834
|
+
---------------------------------------------------------
|
1835
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
1836
|
+
---------------------------------------------------------
|
1837
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
1838
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1839
|
+
--------------------------------------------------------------------------------
|
1840
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
1841
|
+
--------------------------------------------------------------------------------
|
1842
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1843
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1844
|
+
------------------------------------------------------------------------------
|
1845
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
1846
|
+
------------------------------------------------------------------------------
|
1847
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1848
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1849
|
+
---------------------------------------------------
|
1850
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
1851
|
+
---------------------------------------------------
|
1852
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1853
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1854
|
+
-------------------------------------------------
|
1855
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
1856
|
+
-------------------------------------------------
|
1857
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1858
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1859
|
+
[1m[36m (2.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1860
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1861
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1862
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1863
|
+
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1864
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1865
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1866
|
+
---------------------------------------------------
|
1867
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
1868
|
+
---------------------------------------------------
|
1869
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1870
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1871
|
+
-------------------------------------------------
|
1872
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
1873
|
+
-------------------------------------------------
|
1874
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1875
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1876
|
+
------------------------------------------------------------------------------
|
1877
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
1878
|
+
------------------------------------------------------------------------------
|
1879
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1880
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1881
|
+
-------------------------------------------------
|
1882
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
1883
|
+
-------------------------------------------------
|
1884
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1885
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1886
|
+
-----------------------------------------------
|
1887
|
+
PoroGeneratorTest: test_rspec_test_is_generated
|
1888
|
+
-----------------------------------------------
|
1889
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1890
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1891
|
+
----------------------------------------------------
|
1892
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
1893
|
+
----------------------------------------------------
|
1894
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1895
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1896
|
+
---------------------------------------------------------
|
1897
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
1898
|
+
---------------------------------------------------------
|
1899
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1900
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1901
|
+
--------------------------------------------------------------------------------
|
1902
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
1903
|
+
--------------------------------------------------------------------------------
|
1904
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1905
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1906
|
+
[1m[36m (2.8ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1907
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1908
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1909
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1910
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1911
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1912
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1913
|
+
----------------------------------------------------
|
1914
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
1915
|
+
----------------------------------------------------
|
1916
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1917
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1918
|
+
---------------------------------------------------------
|
1919
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
1920
|
+
---------------------------------------------------------
|
1921
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1922
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1923
|
+
--------------------------------------------------------------------------------
|
1924
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
1925
|
+
--------------------------------------------------------------------------------
|
1926
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1927
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1928
|
+
---------------------------------------------------
|
1929
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
1930
|
+
---------------------------------------------------
|
1931
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1932
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1933
|
+
-------------------------------------------------
|
1934
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
1935
|
+
-------------------------------------------------
|
1936
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1937
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1938
|
+
------------------------------------------------------------------------------
|
1939
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
1940
|
+
------------------------------------------------------------------------------
|
1941
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1942
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
1943
|
+
-------------------------------------------------
|
1944
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
1945
|
+
-------------------------------------------------
|
1946
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1947
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1948
|
+
-----------------------------------------------
|
1949
|
+
PoroGeneratorTest: test_rspec_test_is_generated
|
1950
|
+
-----------------------------------------------
|
1951
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1952
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1953
|
+
[1m[36m (3.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1954
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1955
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1956
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1957
|
+
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1958
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1959
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1960
|
+
-------------------------------------------------
|
1961
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
1962
|
+
-------------------------------------------------
|
1963
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1964
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1965
|
+
------------------------------------------------------------------------------
|
1966
|
+
PoroGeneratorTest: test_minitest_file_is_generated_when_test-suite_is_minitest
|
1967
|
+
------------------------------------------------------------------------------
|
1968
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1969
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1970
|
+
-----------------------------------------------
|
1971
|
+
PoroGeneratorTest: test_rspec_file_is_generated
|
1972
|
+
-----------------------------------------------
|
1973
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1974
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1975
|
+
-------------------------------------------------
|
1976
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
1977
|
+
-------------------------------------------------
|
1978
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1979
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1980
|
+
------------------------------------------------------------------------------
|
1981
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
1982
|
+
------------------------------------------------------------------------------
|
1983
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1984
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1985
|
+
---------------------------------------------------
|
1986
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
1987
|
+
---------------------------------------------------
|
1988
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1989
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1990
|
+
---------------------------------------------------------
|
1991
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
1992
|
+
---------------------------------------------------------
|
1993
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1994
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1995
|
+
----------------------------------------------------
|
1996
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
1997
|
+
----------------------------------------------------
|
1998
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1999
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2000
|
+
--------------------------------------------------------------------------------
|
2001
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
2002
|
+
--------------------------------------------------------------------------------
|
2003
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2004
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2005
|
+
[1m[36m (3.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2006
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
2007
|
+
[1m[36m (1.4ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
2008
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
2009
|
+
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
2010
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
2011
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2012
|
+
---------------------------------------------------
|
2013
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
2014
|
+
---------------------------------------------------
|
2015
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2016
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2017
|
+
------------------------------------------------------------------------------
|
2018
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
2019
|
+
------------------------------------------------------------------------------
|
2020
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
2021
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2022
|
+
-------------------------------------------------
|
2023
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
2024
|
+
-------------------------------------------------
|
2025
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2026
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2027
|
+
--------------------------------------------------------------------------------
|
2028
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
2029
|
+
--------------------------------------------------------------------------------
|
2030
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2031
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2032
|
+
---------------------------------------------------------
|
2033
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
2034
|
+
---------------------------------------------------------
|
2035
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
2036
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
2037
|
+
----------------------------------------------------
|
2038
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
2039
|
+
----------------------------------------------------
|
2040
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
2041
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2042
|
+
-------------------------------------------------
|
2043
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
2044
|
+
-------------------------------------------------
|
2045
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
2046
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2047
|
+
-----------------------------------------------
|
2048
|
+
PoroGeneratorTest: test_rspec_file_is_generated
|
2049
|
+
-----------------------------------------------
|
2050
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2051
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2052
|
+
------------------------------------------------------------------------------
|
2053
|
+
PoroGeneratorTest: test_minitest_file_is_generated_when_test-suite_is_minitest
|
2054
|
+
------------------------------------------------------------------------------
|
2055
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2056
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2057
|
+
[1m[36m (4.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2058
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
2059
|
+
[1m[36m (1.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
2060
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
2061
|
+
[1m[36m (1.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
2062
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
2063
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2064
|
+
-------------------------------------------------
|
2065
|
+
PolicyGeneratorTest: test_rspec_file_is_generated
|
2066
|
+
-------------------------------------------------
|
2067
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2068
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2069
|
+
------------------------------------------------------------------------------
|
2070
|
+
PolicyGeneratorTest: test_if_minitest_is_specified,_minitest_file_is_generated
|
2071
|
+
------------------------------------------------------------------------------
|
2072
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
2073
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2074
|
+
---------------------------------------------------
|
2075
|
+
PolicyGeneratorTest: test_correct_file_is_generated
|
2076
|
+
---------------------------------------------------
|
2077
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2078
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2079
|
+
-----------------------------------------------
|
2080
|
+
PoroGeneratorTest: test_rspec_file_is_generated
|
2081
|
+
-----------------------------------------------
|
2082
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2083
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2084
|
+
------------------------------------------------------------------------------
|
2085
|
+
PoroGeneratorTest: test_minitest_file_is_generated_when_test-suite_is_minitest
|
2086
|
+
------------------------------------------------------------------------------
|
2087
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2088
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2089
|
+
-------------------------------------------------
|
2090
|
+
PoroGeneratorTest: test_correct_file_is_generated
|
2091
|
+
-------------------------------------------------
|
2092
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2093
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2094
|
+
----------------------------------------------------
|
2095
|
+
ServiceGeneratorTest: test_correct_file_is_generated
|
2096
|
+
----------------------------------------------------
|
2097
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2098
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2099
|
+
--------------------------------------------------------------------------------
|
2100
|
+
ServiceGeneratorTest: test_generates_minitest_file_if_test-framework_is_minitest
|
2101
|
+
--------------------------------------------------------------------------------
|
2102
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2103
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2104
|
+
---------------------------------------------------------
|
2105
|
+
ServiceGeneratorTest: test_correct_spec_file_is_generated
|
2106
|
+
---------------------------------------------------------
|
2107
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'generators/poro/poro_generator'
|
3
|
+
|
4
|
+
class PoroGeneratorTest < Rails::Generators::TestCase
|
5
|
+
tests PoroGenerator
|
6
|
+
|
7
|
+
destination File.join(Rails.root)
|
8
|
+
teardown :cleanup
|
9
|
+
|
10
|
+
def cleanup
|
11
|
+
FileUtils.rm_rf(File.join(Rails.root, 'app/models'))
|
12
|
+
FileUtils.rm_rf(File.join(Rails.root, 'spec/models'))
|
13
|
+
FileUtils.rm_rf(File.join(Rails.root, 'test/models'))
|
14
|
+
end
|
15
|
+
|
16
|
+
test 'correct file is generated' do
|
17
|
+
run_generator %w(grade)
|
18
|
+
|
19
|
+
assert_file 'app/models/grade.rb' do |content|
|
20
|
+
assert_match /class Grade/, content
|
21
|
+
assert_no_match /ActiveRecord::Base/, content
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
test 'rspec file is generated' do
|
26
|
+
run_generator %w(grade)
|
27
|
+
|
28
|
+
assert_file 'spec/models/grade_spec.rb' do |content|
|
29
|
+
assert_match /RSpec.describe Grade do/, content
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
test 'minitest file is generated when test-suite is minitest' do
|
34
|
+
run_generator %w(grade --test-suite=minitest)
|
35
|
+
|
36
|
+
assert_file 'test/models/grade_test.rb' do |content|
|
37
|
+
assert_match /class GradeTest < MiniTest::Test/, content
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pattern_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sung Won Cho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -80,6 +80,10 @@ files:
|
|
80
80
|
- lib/generators/policy/templates/policy.rb
|
81
81
|
- lib/generators/policy/templates/policy_spec.rb
|
82
82
|
- lib/generators/policy/templates/policy_test.rb
|
83
|
+
- lib/generators/poro/poro_generator.rb
|
84
|
+
- lib/generators/poro/templates/poro.rb
|
85
|
+
- lib/generators/poro/templates/poro_spec.rb
|
86
|
+
- lib/generators/poro/templates/poro_test.rb
|
83
87
|
- lib/generators/service/service_generator.rb
|
84
88
|
- lib/generators/service/templates/service.rb
|
85
89
|
- lib/generators/service/templates/service_spec.rb
|
@@ -126,6 +130,7 @@ files:
|
|
126
130
|
- test/dummy/public/500.html
|
127
131
|
- test/dummy/public/favicon.ico
|
128
132
|
- test/generators/policy_generator_test.rb
|
133
|
+
- test/generators/poro_generator_test.rb
|
129
134
|
- test/generators/service_generator_test.rb
|
130
135
|
- test/test_helper.rb
|
131
136
|
homepage: https://github.com/sungwoncho/pattern_generator
|
@@ -192,5 +197,6 @@ test_files:
|
|
192
197
|
- test/dummy/Rakefile
|
193
198
|
- test/dummy/README.rdoc
|
194
199
|
- test/generators/policy_generator_test.rb
|
200
|
+
- test/generators/poro_generator_test.rb
|
195
201
|
- test/generators/service_generator_test.rb
|
196
202
|
- test/test_helper.rb
|