Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant Cell::Testing::Uber (NameError) #321

Closed
CJYate opened this issue Sep 22, 2015 · 9 comments
Closed

uninitialized constant Cell::Testing::Uber (NameError) #321

CJYate opened this issue Sep 22, 2015 · 9 comments

Comments

@CJYate
Copy link

CJYate commented Sep 22, 2015

I'm seeing a problem when using cells with rspec-cells.
After creating the repo and a scaffold, I created a cell:

00:37 $ rails g cell thing
      create  app/cells/thing_cell.rb
      create  app/cells/thing/show.erb
      invoke  test_unit
      create    test/cells/thing_cell_test.rb

But I want rspec tests, so after installing rspec-rails:

00:25 $ rails g cell thing2
create app/cells/thing2_cell.rb
create app/cells/thing2/show.erb
error rspec [not found]

What do to? Install rspec-cells, maybe? After that:

00:28 $ rails g cell thing2
/home/cjbrew/.rvm/gems/ruby-2.1.5/gems/cells-4.0.2/lib/cell/testing.rb:61:in block in included': uninitialized constant Cell::Testing::Uber (NameError) from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/cells-4.0.2/lib/cell/testing.rb:60:inclass_eval'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/cells-4.0.2/lib/cell/testing.rb:60:in included' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec/cells/example_group.rb:7:ininclude'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec/cells/example_group.rb:7:in <module:ExampleGroup>' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec/cells/example_group.rb:3:inmodule:Cells'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec/cells/example_group.rb:2:in <module:RSpec>' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec/cells/example_group.rb:1:in'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec/cells.rb:7:in <top (required)>' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec-cells.rb:17:inrequire'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/rspec-cells-0.3.3/lib/rspec-cells.rb:17:in <top (required)>' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:inrequire'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in block (2 levels) in require' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:ineach'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in block in require' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:ineach'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in require' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/bundler-1.10.6/lib/bundler.rb:134:inrequire'
from /home/cjbrew/Dev/celltests/config/application.rb:7:in <top (required)>' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:82:inrequire'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:82:in preload' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:143:inserve'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:131:in block in run' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:125:inloop'
from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:125:in run' from /home/cjbrew/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application/boot.rb:18:in'
from /home/cjbrew/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in require' from /home/cjbrew/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from -e:1:in `

Any ideas?

In order to show the Gemfile etc I've uploaded my bug-demo repository at https://github.com/CJBrew/cell_rails.

Ubuntu system with Rails 4.2.4

@CJYate
Copy link
Author

CJYate commented Sep 22, 2015

I saw this: #270

Have tested with the github link in my Gemfile and it doesn't appear to solve the problem,

@apotonick
Copy link
Member

You're not including the cells gem! See here: https://github.com/apotonick/cells#installation

@CJYate
Copy link
Author

CJYate commented Sep 23, 2015

/facepalm

For some reason that wasn't clear enough. Thank you.

@CJYate
Copy link
Author

CJYate commented Sep 24, 2015

@apotonick, thanks for the pointer to the cells gem; however there still seems to be an issue with generating Concepts (sorry, I deleted my example repo).

It's this issue: trailblazer/rspec-cells#57

01:54 $ rails g concept Frog get post
      create  app/concepts/frog/cell.rb
      create  app/concepts/frog/views/show.erb
      create  app/concepts/frog/views/get.erb
      create  app/concepts/frog/views/post.erb
       error  rspec [not found]

I'm not really sure what I gain from using Concepts over Cells -- what I'm really after is a nice ViewModel-like layer.

@apotonick
Copy link
Member

Concept cells are cells that follow the Trailblazer file and naming layout: https://github.com/apotonick/cells#concept-cells They are basically identical to normal cells but instead of CommentCell, they use namespacing, e.g. Comment::Cell.

@agm1988
Copy link

agm1988 commented Aug 4, 2016

same issue using trailblazer
added rspec-cells gem

/gems/bundler-1.12.5/lib/bundler/runtime.rb:89:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'rspec-cells'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant Cell::Testing::Uber

@apotonick
Copy link
Member

Cool @agm1988 that might help me fixing the issue!

@agm1988
Copy link

agm1988 commented Aug 4, 2016

@apotonick trailblazer/rspec-cells#84
also opened here

@apotonick
Copy link
Member

Thanks @agm1988 for following up on this. Can you please test cells/master if it works for you?

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

No branches or pull requests

3 participants