Steak is working great for me without Spork but whenever I run it
using Spork I get "undefined local variable" errors whenever my code
hits a helper method. Has anyone had any similar issues? My spork (if
that's relevant).
Spork.prefork do
# Loading more in this block will cause your tests to run faster.
However,
# if you change any configuration or code from libraries loaded
here, you'll
# need to restart spork for it take effect.
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros,
etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
end
Spork.each_run do
# This code will be run each time you run your specs.
Dir[Rails.root.join("site/app/**/*.rb")].each {|f| require f}
load "#{Rails.root}/spec/global_test_helper.rb"
> Steak is working great for me without Spork but whenever I run it
> using Spork I get "undefined local variable" errors whenever my code
> hits a helper method. Has anyone had any similar issues? My spork (if
> that's relevant).
> Spork.prefork do
> # Loading more in this block will cause your tests to run faster.
> However,
> # if you change any configuration or code from libraries loaded
> here, you'll
> # need to restart spork for it take effect.
> require File.expand_path("../../config/environment", __FILE__)
> require 'rspec/rails'
> # Requires supporting ruby files with custom matchers and macros,
> etc,
> # in spec/support/ and its subdirectories.
> Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
> end
> Spork.each_run do
> # This code will be run each time you run your specs.
> Dir[Rails.root.join("site/app/**/*.rb")].each {|f| require f}
> load "#{Rails.root}/spec/global_test_helper.rb"
Sure thing Tiago. When I run the acceptance tests I get this
backtrace:
Failure/Error: login_as_admin
ActionView::Template::Error:
undefined local variable or method `typekit_fonts' for
#<#<Class:0x4fd8f78>:0x4fd718c>
# ./site/app/views/layouts/spree_application.html.erb:6:in `block
in
_site_app_views_layouts_spree_application_html_erb__511333542_41843800_4659 09208'
# ./site/app/views/layouts/spree_application.html.erb:3:in
`_site_app_views_layouts_spree_application_html_erb__511333542_41843800_465 909208'
# <internal:prelude>:10:in `synchronize'
# ./spec/acceptance/support/helpers.rb:18:in `login'
# ./spec/acceptance/support/helpers.rb:12:in `login_as_admin'
# ./spec/acceptance/buyer_inquiries_count_spec.rb:16:in `block (2
levels) in <top (required)>'
The supposedly undefined local variable or method is defined in my
ApplicationHelper and works fine in non sporked steaks. I can't figure
out the methods don't get included in the sporked process.
On Apr 17, 1:50 pm, Tiago Albineli Motta <timo...@gmail.com> wrote:
> On Apr 15, 6:29 am, Jack Kinsella <jack.kinse...@gmail.com> wrote:
> > Hey,
> > Steak is working great for me without Spork but whenever I run it
> > using Spork I get "undefined local variable" errors whenever my code
> > hits a helper method. Has anyone had any similar issues? My spork (if
> > that's relevant).
> > Spork.prefork do
> > # Loading more in this block will cause your tests to run faster.
> > However,
> > # if you change any configuration or code from libraries loaded
> > here, you'll
> > # need to restart spork for it take effect.
> > require File.expand_path("../../config/environment", __FILE__)
> > require 'rspec/rails'
> > # Requires supporting ruby files with custom matchers and macros,
> > etc,
> > # in spec/support/ and its subdirectories.
> > Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
> > end
> > Spork.each_run do
> > # This code will be run each time you run your specs.
> > Dir[Rails.root.join("site/app/**/*.rb")].each {|f| require f}
> > load "#{Rails.root}/spec/global_test_helper.rb"
> > require "#{Rails.root}/spec/factories.rb"
> > end
Same problem here. Paths and helper methods under acceptance/support
are not accessible (undefined local variable or method). I am also
using Spork (latest from Github) and Ruby 1.9.2 under Rails 3.0.7.
On Apr 15, 11:29 am, Jack Kinsella <jack.kinse...@gmail.com> wrote:
> Steak is working great for me without Spork but whenever I run it
> using Spork I get "undefined local variable" errors whenever my code
> hits a helper method. Has anyone had any similar issues? My spork (if
> that's relevant).
> Spork.prefork do
> # Loading more in this block will cause your tests to run faster.
> However,
> # if you change any configuration or code from libraries loaded
> here, you'll
> # need to restart spork for it take effect.
> require File.expand_path("../../config/environment", __FILE__)
> require 'rspec/rails'
> # Requires supporting ruby files with custom matchers and macros,
> etc,
> # in spec/support/ and its subdirectories.
> Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
> end
> Spork.each_run do
> # This code will be run each time you run your specs.
> Dir[Rails.root.join("site/app/**/*.rb")].each {|f| require f}
> load "#{Rails.root}/spec/global_test_helper.rb"