Skip to content

Add some basic specs#4

Open
lukeasrodgers wants to merge 1 commit intomrinterweb:mainfrom
lukeasrodgers:add-specs
Open

Add some basic specs#4
lukeasrodgers wants to merge 1 commit intomrinterweb:mainfrom
lukeasrodgers:add-specs

Conversation

@lukeasrodgers
Copy link

@lukeasrodgers lukeasrodgers commented Feb 4, 2023

Thanks for your work on this gem, it is almost exactly what I've been looking for (and was about to try to write).

Nothing revolutionary here with the tests, just getting the spec ball rolling, mostly.

Nothing revolutionary, just getting the spec ball rolling, mostly.
@@ -0,0 +1,5 @@
{
users: {
name: -> { "Jimbo #{SecureRandom.hex(8)}" }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just demonstrating what a "dynamic" definition could look like, could use faker instead if more realistic usage was desirable

@@ -0,0 +1,176 @@
--
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a very basic dump file created for this purpose

may be desirable in the future to also test

  • different pg dump versions
  • more exotic column types
  • may want some data that could intentionally try to break line_regex, a la bobby tables https://xkcd.com/327/

Copy link

@yorsant yorsant Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I haven't looked at the test jet, but I started to use the gem (thanks for creating it), and I had an error (extra data after last expected column) that may be related to having the delimiter inside text columns.
Some instructions could be added to the readme about handling this case.
Also, I had to specify plain text format and utf-8 for my dumb file to avoid weird characters.

I'll read more to confirm if this is a bug unless someone has experienced it before and reply with some advice.


it "does something useful" do
expect(false).to eq(true)
it "can process a file with no transformations, producing an exact copy" do
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't put too much thought into these, definitely not suggesting they come close to exhausting the set of behaviour that would be good to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants