radar / twist

Book review application for LeanPub's Markdown format
MIT License
103 stars 30 forks source link

error on the page 9: Errno::ENOENT: No such file or directory @ unlink_internal - /twist/repos/radar/markdown_book_test #16

Closed romenigld closed 7 years ago

romenigld commented 7 years ago
$ ruby -v 
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
➜  twist git:(master) rails -v
Rails 5.0.0.1

I'm following these steps on the page 9:

git clone git@github.com:radar/twist
cd twist
git submodule update --init
bundle install
rake db:setup
bundle exec rspec spec

when I try to clone I get these errors:

git clone git@github.com:radar/twist
Cloning into 'twist'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

and was just possible to clone with this: git clone https://github.com/radar/twist.git

So the rest worked fine until the rake db:setup because I have problems with postgresql. For fix was this command: brew services start postgres thenrake db:setup works great.

So the `git submodule update --init` was cloned for there:
$ tree spec/fixtures/repos/radar/
spec/fixtures/repos/radar/
└── markdown_book_test
    ├── Book.txt
    ├── appendix.markdown
    ├── chapter_1
    │   └── chapter_1.markdown
    ├── chapter_2
    │   └── chapter_2.markdown
    ├── images
    │   └── chapter_1
    │       └── 1.png
    └── introduction.markdown

5 directories, 6 files

And then when I try to running the RSpec command I get these errors:

`➜ twist git:(master) bundle exec rspec spec .Too many arguments. usage: git clone [] [--] [

]

-v, --verbose         be more verbose
-q, --quiet           be more quiet
--progress            force progress reporting
-n, --no-checkout     don't create a checkout
--bare                create a bare repository
--mirror              create a mirror repository (implies bare)
-l, --local           to clone from a local repository
--no-hardlinks        don't use local hardlinks, always copy
-s, --shared          setup as shared repository
--recursive           initialize submodules in the clone
--recurse-submodules  initialize submodules in the clone
-j, --jobs <n>        number of submodules cloned in parallel
--template <template-directory>
                      directory from which templates will be used
--reference <repo>    reference repository
--dissociate          use --reference only while cloning
-o, --origin <name>   use <name> instead of 'origin' to track upstream
-b, --branch <branch>
                      checkout <branch> instead of the remote's HEAD
-u, --upload-pack <path>
                      path to git-upload-pack on the remote
--depth <depth>       create a shallow clone of that depth
--single-branch       clone only one branch, HEAD or --branch
--shallow-submodules  any cloned submodules will be shallow
--separate-git-dir <gitdir>
                      separate git dir from working tree
-c, --config <key=value>
                      set config inside the new repository
-4, --ipv4            use IPv4 addresses only
-6, --ipv6            use IPv6 addresses only

FF

It's trying to go in twist/repos/radar/markdown_book_testbut the path is twist/spec/fixtures/repos/radar/markdown_book_test

FF

Failures:

  1) Books navigating sees a list of frontmatter / mainmatter / backmatter
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  2) Books navigating can navigate through all the book
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  3) commenting as an author a normal comment
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  4) commenting as an author accepting a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  5) commenting as an author rejecting a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  6) notes can add a new note to a paragraph
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  7) notes can view all notes for a book
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  8) notes can reopen a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  9) notes changing a note's state can accept a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  10) notes changing a note's state can reject a note
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  11) signing out can sign out
      Failure/Error: click_link "Sign in"

      Capybara::ElementNotFound:
        Unable to find link "Sign in"

  12) Git updates an existing repository
      Failure/Error: `git clone -q #{self.class.host}#{user}/#{repo} #{path}`

        #<Git:0x007fe13a5d90f8 @user="radar", @repo="markdown_book_test"> received :` with unexpected arguments
          expected: ("git checkout -q")
               got: ("git clone -q /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/spec/fixtur...romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test")

  13) Book upon creation processes a test Markdown book
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  14) Chapter can process markdown
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  15) Chapter updating an existing chapter keeps elements with notes
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  16) Chapter navigation chapter 1 links back to only chapter in previous part
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  17) Chapter navigation chapter 1 links back to highest positioned chapter in previous part
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  18) Chapter navigation chapter 1 links to next chapter in same part
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  19) Chapter navigation last chapter of part links back to previous chapter
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  20) Chapter navigation last chapter of part links to first chapter in next part
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  21) Comment upon creation sends an email to note author + commentors, minus comment owner
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  22) Comment upon creation sends notification emails to the right users
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  23) Chapter processes a chapter
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

Finished in 6.9 seconds (files took 10.71 seconds to load)
48 examples, 23 failures

Failed examples:

rspec ./spec/features/books_spec.rb:12 # Books navigating sees a list of frontmatter / mainmatter / backmatter
rspec ./spec/features/books_spec.rb:29 # Books navigating can navigate through all the book
rspec ./spec/features/comments_spec.rb:29 # commenting as an author a normal comment
rspec ./spec/features/comments_spec.rb:38 # commenting as an author accepting a note
rspec ./spec/features/comments_spec.rb:48 # commenting as an author rejecting a note
rspec ./spec/features/notes_spec.rb:10 # notes can add a new note to a paragraph
rspec ./spec/features/notes_spec.rb:38 # notes can view all notes for a book
rspec ./spec/features/notes_spec.rb:89 # notes can reopen a note
rspec ./spec/features/notes_spec.rb:75 # notes changing a note's state can accept a note
rspec ./spec/features/notes_spec.rb:82 # notes changing a note's state can reject a note
rspec ./spec/features/users/signing_out_spec.rb:10 # signing out can sign out
rspec ./spec/lib/git_spec.rb:25 # Git updates an existing repository
rspec ./spec/models/book_spec.rb:41 # Book upon creation processes a test Markdown book
rspec ./spec/models/chapter_spec.rb:13 # Chapter can process markdown
rspec ./spec/models/chapter_spec.rb:42 # Chapter updating an existing chapter keeps elements with notes
rspec ./spec/models/chapter_spec.rb:61 # Chapter navigation chapter 1 links back to only chapter in previous part
rspec ./spec/models/chapter_spec.rb:71 # Chapter navigation chapter 1 links back to highest positioned chapter in previous part
rspec ./spec/models/chapter_spec.rb:88 # Chapter navigation chapter 1 links to next chapter in same part
rspec ./spec/models/chapter_spec.rb:116 # Chapter navigation last chapter of part links back to previous chapter
rspec ./spec/models/chapter_spec.rb:120 # Chapter navigation last chapter of part links to first chapter in next part
rspec ./spec/models/comment_spec.rb:28 # Comment upon creation sends an email to note author + commentors, minus comment owner
rspec ./spec/models/comment_spec.rb:39 # Comment upon creation sends notification emails to the right users
rspec ./spec/models/markdown_chapter_spec.rb:20 # Chapter processes a chapter

what I need to do for fix?

radar commented 7 years ago

Would you mind reducing the output a little? It's quite a lot to scroll through.

Did you just run through the steps in the readme?

radar commented 7 years ago

It should check it out to repos/radar/markdown_book_test

romenigld commented 7 years ago

Sorry about put everything. I just want to put what occurs for you knows what is happening, it's is strange the error in the beginning, why the error it's repeating a lot of code like

F.................Too many arguments.
usage: git clone [] [--] [

The steps I'm using was in the ebook Multitenancy with rails 2nd version.

I need to do something?

radar commented 7 years ago

Removed a bunch of irrelevant info from the OP.


git clone git@github.com:radar/twist
Cloning into 'twist'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

This looks like you don't have your SSH key setup correctly on GitHub, and I think that may to be blame for the other issues that you're seeing too. The git.rb file within Twist clones things using git@github.com as well, and so if you can't clone Twist using git@github.com then you'll have issues cloning down the test project that the book uses too.

So in short: add an SSH key to GitHub and this should fix your issue.

romenigld commented 7 years ago

Hello Ryan Bigg, this problem with SSH keys was solved thank's. But the 23 failures persists when I try to run the rspec command.

 23) Chapter processes a chapter
      Failure/Error: FileUtils.rm_r(git.path)

      Errno::ENOENT:
        No such file or directory @ unlink_internal - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test
      # ./spec/models/markdown_chapter_spec.rb:15:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:40:in `block (3 levels) in <top (required)>'
      # /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/generic/base.rb:16:in `cleaning'
      # /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/base.rb:98:in `cleaning'
      # /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/configuration.rb:86:in `block (2 levels) in cleaning'
      # /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/configuration.rb:87:in `cleaning'
      # ./spec/rails_helper.rb:39:in `block (2 levels) in <top (required)>'

Finished in 13.21 seconds (files took 4.74 seconds to load)
48 examples, 23 failures

Failed examples:

rspec ./spec/features/books_spec.rb:12 # Books navigating sees a list of frontmatter / mainmatter / backmatter
rspec ./spec/features/books_spec.rb:29 # Books navigating can navigate through all the book
rspec ./spec/features/comments_spec.rb:29 # commenting as an author a normal comment
rspec ./spec/features/comments_spec.rb:38 # commenting as an author accepting a note
rspec ./spec/features/comments_spec.rb:48 # commenting as an author rejecting a note
rspec ./spec/features/notes_spec.rb:10 # notes can add a new note to a paragraph
rspec ./spec/features/notes_spec.rb:38 # notes can view all notes for a book
rspec ./spec/features/notes_spec.rb:89 # notes can reopen a note
rspec ./spec/features/notes_spec.rb:75 # notes changing a note's state can accept a note
rspec ./spec/features/notes_spec.rb:82 # notes changing a note's state can reject a note
rspec ./spec/features/users/signing_out_spec.rb:10 # signing out can sign out
rspec ./spec/lib/git_spec.rb:25 # Git updates an existing repository
rspec ./spec/models/book_spec.rb:41 # Book upon creation processes a test Markdown book
rspec ./spec/models/chapter_spec.rb:13 # Chapter can process markdown
rspec ./spec/models/chapter_spec.rb:42 # Chapter updating an existing chapter keeps elements with notes
rspec ./spec/models/chapter_spec.rb:61 # Chapter navigation chapter 1 links back to only chapter in previous part
rspec ./spec/models/chapter_spec.rb:71 # Chapter navigation chapter 1 links back to highest positioned chapter in previous part
rspec ./spec/models/chapter_spec.rb:88 # Chapter navigation chapter 1 links to next chapter in same part
rspec ./spec/models/chapter_spec.rb:116 # Chapter navigation last chapter of part links back to previous chapter
rspec ./spec/models/chapter_spec.rb:120 # Chapter navigation last chapter of part links to first chapter in next part
rspec ./spec/models/comment_spec.rb:28 # Comment upon creation sends an email to note author + commentors, minus comment owner
rspec ./spec/models/comment_spec.rb:39 # Comment upon creation sends notification emails to the right users
rspec ./spec/models/markdown_chapter_spec.rb:20 # Chapter processes a chapter
radar commented 7 years ago

I was able to reproduce this by manually deleting repos/radar/markdown_book_test. I think this was caused by using rm_r instead of rm_rf, which I've now fixed up with: 178fc6a21e1c7f8507753215eb060cc978710fd2

Could you please try again and let me know if that eliminates all your test failures?

romenigld commented 7 years ago

Hello Ryan, thank's for reply. And I'm sorry about that, but now it has 18 failures:

Failures:

  1) Books navigating sees a list of frontmatter / mainmatter / backmatter
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  2) Books navigating can navigate through all the book
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  3) commenting as an author a normal comment
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  4) commenting as an author accepting a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  5) commenting as an author rejecting a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  6) notes can add a new note to a paragraph
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  7) notes can view all notes for a book
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  8) notes can reopen a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  9) notes changing a note's state can accept a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  10) notes changing a note's state can reject a note
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  11) signing out can sign out
      Failure/Error: click_link "Sign in"

      Capybara::ElementNotFound:
        Unable to find link "Sign in"

  12) Git updates an existing repository
      Failure/Error: `git clone -q #{self.class.host}#{user}/#{repo} #{path}`

        #<Git:0x007f8ecdfc22f0 @user="radar", @repo="markdown_book_test"> received :` with unexpected arguments
          expected: ("git checkout -q")
               got: ("git clone -q /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/spec/fixtur...romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test")

  13) Book upon creation processes a test Markdown book
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  14) Chapter can process markdown
      Failure/Error:
        expect do
          chapter.process!
        end.not_to raise_error

        expected no Exception, got #<Errno::ENOENT: No such file or directory @ rb_sysopen - spec/fixtures/repos/radar/markdown_book_test/chapter_1/chapter_1.markdown> with backtrace:

  15) Chapter updating an existing chapter keeps elements with notes
      Failure/Error: markdown = File.read(File.join(book.path, file_name))

      Errno::ENOENT:
        No such file or directory @ rb_sysopen - spec/fixtures/repos/radar/markdown_book_test/chapter_1/chapter_1.markdown

  16) Comment upon creation sends an email to note author + commentors, minus comment owner
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  17) Comment upon creation sends notification emails to the right users
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  18) Chapter processes a chapter
      Failure/Error: markdown = File.read(File.join(book.path, file_name))

      Errno::ENOENT:
        No such file or directory @ rb_sysopen - spec/fixtures/repos/radar/markdown_book_test/chapter_1/chapter_1.markdown

Finished in 11.65 seconds (files took 4.17 seconds to load)
48 examples, 18 failures

Failed examples:

rspec ./spec/features/books_spec.rb:12 # Books navigating sees a list of frontmatter / mainmatter / backmatter
rspec ./spec/features/books_spec.rb:29 # Books navigating can navigate through all the book
rspec ./spec/features/comments_spec.rb:29 # commenting as an author a normal comment
rspec ./spec/features/comments_spec.rb:38 # commenting as an author accepting a note
rspec ./spec/features/comments_spec.rb:48 # commenting as an author rejecting a note
rspec ./spec/features/notes_spec.rb:10 # notes can add a new note to a paragraph
rspec ./spec/features/notes_spec.rb:38 # notes can view all notes for a book
rspec ./spec/features/notes_spec.rb:89 # notes can reopen a note
rspec ./spec/features/notes_spec.rb:75 # notes changing a note's state can accept a note
rspec ./spec/features/notes_spec.rb:82 # notes changing a note's state can reject a note
rspec ./spec/features/users/signing_out_spec.rb:10 # signing out can sign out
rspec ./spec/lib/git_spec.rb:25 # Git updates an existing repository
rspec ./spec/models/book_spec.rb:41 # Book upon creation processes a test Markdown book
rspec ./spec/models/chapter_spec.rb:13 # Chapter can process markdown
rspec ./spec/models/chapter_spec.rb:42 # Chapter updating an existing chapter keeps elements with notes
rspec ./spec/models/comment_spec.rb:28 # Comment upon creation sends an email to note author + commentors, minus comment owner
rspec ./spec/models/comment_spec.rb:39 # Comment upon creation sends notification emails to the right users
rspec ./spec/models/markdown_chapter_spec.rb:20 # Chapter processes a chapter
radar commented 7 years ago

I can reproduce the issue, but I am not sure if this is the cause of it or not, since you've only included the output from "Failures"... Here's what I did:

  1. Deleted spec/fixtures/repos/radar/markdown_book_test.
  2. Ran bundle exec rspec spec/models/comment_spec.rb
  3. Saw it failed in the same way that you showed.

My output includes these lines above "Failures":

fatal: repository '/Users/ryanbigg/code/twist/spec/fixtures/repos/radar/markdown_book_test' does not exist
fatal: repository '/Users/ryanbigg/code/twist/spec/fixtures/repos/radar/markdown_book_test' does not exist
Ffatal: repository '/Users/ryanbigg/code/twist/spec/fixtures/repos/radar/markdown_book_test' does not exist
fatal: repository '/Users/ryanbigg/code/twist/spec/fixtures/repos/radar/markdown_book_test' does not exist

I fixed this by running git submodule update --init, which will re-initialize the spec/fixtures/repos/radar/markdown_book_test directory.

I am not sure if this is actually the same problem that you're seeing, but it's my best guess so far.

Could you please try running this at the root of the project and report back?

git submodule update --init

Thank you for your patience.

romenigld commented 7 years ago

Hello Ryan I do what you told me to do and I do like you to(deleting the spec/fixtures/repos/radar/markdown_book_test), etc... And here was which occur:

$ git submodule update --init
Fetched in submodule path 'spec/fixtures/repos/radar/markdown_book_test', but it did not contain 97753aca66e66a54d496db7c743b93c231b54378. Direct fetching of that commit failed.

when I try the spec command it was complained the similar errors above.

 Failure/Error: `git clone -q #{self.class.host}#{user}/#{repo} #{path}`

        #<Git:0x007ff7b7198870 @user="radar", @repo="markdown_book_test"> received :` with unexpected arguments
          expected: ("git checkout -q")
               got: ("git clone -q /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/spec/fixtur...romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test")
.
.
.
Errno::ENOENT:
        No such file or directory @ rb_sysopen - spec/fixtures/repos/radar/markdown_book_test/chapter_1/chapter_1.markdown
48 examples, 18 failures
radar commented 7 years ago

I am not sure here what is wrong. Could you please try deleting the twist project and cloning it again from scratch?

romenigld commented 7 years ago

It's something failing when try to run the command: $ git submodule update --init. Isn't coping the files on radar/markdown_book_test. look what's happened:

git clone git@github.com:radar/twist
Cloning into 'twist'...
remote: Counting objects: 7616, done.
remote: Compressing objects: 100% (270/270), done.
remote: Total 7616 (delta 156), reused 0 (delta 0), pack-reused 7339
Receiving objects: 100% (7616/7616), 1.90 MiB | 1.29 MiB/s, done.
Resolving deltas: 100% (4533/4533), done.
➜  Multitenancy with Rails 2nd Edition cd twist
➜  twist git:(master) git submodule update --init
Submodule 'spec/fixtures/repos/radar/markdown_book_test' (git://github.com/radar/markdown_book_test) registered for path 'spec/fixtures/repos/radar/markdown_book_test'
Cloning into '/Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/spec/fixtures/repos/radar/markdown_book_test'...
Fetched in submodule path 'spec/fixtures/repos/radar/markdown_book_test', but it did not contain 97753aca66e66a54d496db7c743b93c231b54378. Direct fetching of that commit failed.
➜  twist git:(master) ✗ tree spec/fixtures/repos/radar/
spec/fixtures/repos/radar/
└── markdown_book_test

1 directory, 0 files

and then when I try to do the rest it's failing in the rspec command.

radar commented 7 years ago

Figured it out. It was because I hadn't pushed a commit from markdown_book_test. I was able to reproduce what you were seeing and have now pushed that commit and verified that it's fixed.

Could you please try again?

romenigld commented 7 years ago

Now was copied the markdown_book_test.

$ tree spec/fixtures/repos/radar/
spec/fixtures/repos/radar/
└── markdown_book_test
    ├── Book.txt
    ├── appendix.markdown
    ├── chapter_1
    │   └── chapter_1.markdown
    ├── chapter_2
    │   └── chapter_2.markdown
    ├── images
    │   └── chapter_1
    │       └── 1.png
    └── introduction.markdown

But the failures in the rspec command now was reduced for 15:

Failures:

  1) Books navigating sees a list of frontmatter / mainmatter / backmatter
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  2) Books navigating can navigate through all the book
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  3) commenting as an author a normal comment
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  4) commenting as an author accepting a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  5) commenting as an author rejecting a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  6) notes can add a new note to a paragraph
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  7) notes can view all notes for a book
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  8) notes can reopen a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  9) notes changing a note's state can accept a note
     Failure/Error:
       Dir.chdir(book.path) do
         lines = File.readlines("Book.txt")
         manifest = book.process_manifest(lines)
         manifest.each do |part, file_names|
           file_names.each_with_index do |file_name, position|
             next if file_name.strip.blank?
             chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
             chapter.position = position + 1
             chapter.process!
           end

     Errno::ENOENT:
       No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  10) notes changing a note's state can reject a note
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  11) signing out can sign out
      Failure/Error: click_link "Sign in"

      Capybara::ElementNotFound:
        Unable to find link "Sign in"

  12) Git updates an existing repository
      Failure/Error: `git clone -q #{self.class.host}#{user}/#{repo} #{path}`

        #<Git:0x007f81dbe817f0 @user="radar", @repo="markdown_book_test"> received :` with unexpected arguments
          expected: ("git checkout -q")
               got: ("git clone -q /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/spec/fixtur...romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test")

  13) Book upon creation processes a test Markdown book
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  14) Comment upon creation sends an email to note author + commentors, minus comment owner
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

  15) Comment upon creation sends notification emails to the right users
      Failure/Error:
        Dir.chdir(book.path) do
          lines = File.readlines("Book.txt")
          manifest = book.process_manifest(lines)
          manifest.each do |part, file_names|
            file_names.each_with_index do |file_name, position|
              next if file_name.strip.blank?
              chapter = book.chapters.find_or_create_by(file_name: file_name, part: part)
              chapter.position = position + 1
              chapter.process!
            end

      Errno::ENOENT:
        No such file or directory @ dir_chdir - /Users/romenigld/workspace/ebooks/Multitenancy with Rails 2nd Edition/twist/repos/radar/markdown_book_test

Finished in 13.01 seconds (files took 12.27 seconds to load)
48 examples, 15 failures

Failed examples:

rspec ./spec/features/books_spec.rb:12 # Books navigating sees a list of frontmatter / mainmatter / backmatter
rspec ./spec/features/books_spec.rb:29 # Books navigating can navigate through all the book
rspec ./spec/features/comments_spec.rb:29 # commenting as an author a normal comment
rspec ./spec/features/comments_spec.rb:38 # commenting as an author accepting a note
rspec ./spec/features/comments_spec.rb:48 # commenting as an author rejecting a note
rspec ./spec/features/notes_spec.rb:10 # notes can add a new note to a paragraph
rspec ./spec/features/notes_spec.rb:38 # notes can view all notes for a book
rspec ./spec/features/notes_spec.rb:89 # notes can reopen a note
rspec ./spec/features/notes_spec.rb:75 # notes changing a note's state can accept a note
rspec ./spec/features/notes_spec.rb:82 # notes changing a note's state can reject a note
rspec ./spec/features/users/signing_out_spec.rb:10 # signing out can sign out
rspec ./spec/lib/git_spec.rb:25 # Git updates an existing repository
rspec ./spec/models/book_spec.rb:41 # Book upon creation processes a test Markdown book
rspec ./spec/models/comment_spec.rb:28 # Comment upon creation sends an email to note author + commentors, minus comment owner
rspec ./spec/models/comment_spec.rb:39 # Comment upon creation sends notification emails to the right users

Don't worry about that I understand this things is part of developing and I appreciate your work, I'm a big fan of you.

radar commented 7 years ago

Ok, I think I've finally fixed the last of these issues. This was caused by a combination of your working directory having a space in it, and me not accounting for such a thing in git.rb within Twist. (There's probably a better way to do what I do in git.rb, but I haven't spent the time to find it.)

Anyway, I was able to replicate this by cloning another copy of Twist to a path on my local machine here which had a space. Then I set about fixing it, and you can see what work was involved with d1065a1.

The tests now all pass on my machine. However, I noticed in your output the spec/features/users/signing_out_spec.rb was failing. I am not sure what the reason for that one is yet. Let me know if it's still an issue and I can investigate.

romenigld commented 7 years ago

Now it works!

 bundle exec rspec spec
................................................

Finished in 27.48 seconds (files took 4.57 seconds to load)
48 examples, 0 failures

I'm exciting for read this book. Thank's Ryan Big!!!

radar commented 7 years ago

Hooray :) Thank you for confirming!