Questions tagged [rake-test]

50 questions
69
votes
2 answers

Using the seed value from rake in unit and functional tests

When running unit and functional tests using rake, on a rails application, I notice that there is a seed value which is specified on the command line: --seed x $ rake test (in /code/blah) Loaded suite…
VirtualStaticVoid
  • 1,656
  • 3
  • 15
  • 21
29
votes
8 answers

'You do not have access to the app' when trying to access heroku console

I recently started collaborating in a project on Heroku using Ruby on Rails. I was added as a collaborator and added the remote to my environment. After some development, I pushed some changes and had no problems: $ git push staging Where staging…
16
votes
2 answers

Add task dependencies to Rake::TestTask

How can I declare task dependencies to a TestTask ? In this example, 'clean_database' task should be run before integration task Rake::TestTask.new(:integration) do |t| t.libs << "test" t.test_files = FileList['test/**/integration/**/test*.rb'] …
Benoît Guérout
  • 1,977
  • 3
  • 21
  • 30
6
votes
2 answers

Running rake test and Rails 'cannot load such file -- rails/performance_test_help

I am trying to run a rake test and I am unable to do it. I keep getting this error: ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" rake aborted! LoadError: cannot load such file --…
WNW
  • 95
  • 1
  • 9
6
votes
4 answers

Spring vs. Zeus performance issue: Spring not running tests much faster after 1st run?

So I'm trying to improve my test execution time, and have been following some of the excellent advice out there (most notably, Railscasts 412). Zeus seems to be working fine (other than the weirdness that requires you to type zeus test test in order…
nlh
  • 1,055
  • 1
  • 10
  • 15
5
votes
1 answer

Rake test - creates YAML error, how do I fix this?

When running a Rake test, I get some errors referring to the YAML file. Any ideas on how to fix it? Running tests: EEEEEEEE Finished tests in 0.070970s, 112.7237 tests/s, 0.0000 assertions/s. 1) Error:…
OnkelK
  • 135
  • 1
  • 2
  • 9
3
votes
2 answers

Tests run from command line but not in RubyMine - No tests were found

I am trying to use RubyMine to run the tests in an existing project. Unfortunately, whenever I attempt to do so I receive the message that No tests were found and the bottom of test console output I see the message: Errors running test:units and…
ahsteele
  • 26,243
  • 28
  • 134
  • 248
3
votes
1 answer

Rake TestTask: run a single test based on command line argument

I currently dynamically generate tests using a JSON file, like so: Rakefile: #... Rake::TestTask.new(:run_spec_tests) { |t| t.libs = ['lib'] t.pattern = 'test/test_spec.rb' t.verbose = true t.warning = false } test/test_spec.rb class…
ray
  • 1,966
  • 4
  • 24
  • 39
3
votes
2 answers

Ruby on Rails Rake throwing "Incorrect table name" error after updating rails project from 4.1.9 to 4.2.0

I have been working on a project for the last couple months, which was originally developed in 4.1.6 and I am now trying to update it to 4.2.0 (I have incrementally tested all version between 4.1.6 and 4.2.0, and all of the 4.1.x version work…
Tezyn
  • 1,314
  • 1
  • 10
  • 24
2
votes
1 answer

How find the file/test which is causing rake test task to terminate?

I'm using a rake task to run the test suites of my application. I can see that when I launch the task it run the command ruby -I"lib:test" -I"[...]/lib" "[...]/lib/rake/rake_test_loader.rb" "vendor/plugins/shop/test/**/*_test.rb" Where [...] is the…
Adrien Coquio
  • 4,870
  • 2
  • 24
  • 37
2
votes
1 answer

Rake test fails with LoadError, looking in home directory

When I try to run "rake test" on my newly generated rails application I receive the following error Computer:heroku user$ rake test:units /Users/user file doesnt…
erikxiv
  • 3,965
  • 1
  • 23
  • 22
2
votes
1 answer

extending Rake's test tasks

I have a few pure-JavaScript, client-side tests using PhantomJS. These I'd like to integrate with rake test. Currently I use this: namespace :test do task :client do basedir = Rails.root.join("test", "client") sh "cd #{basedir} &&…
AnC
  • 4,099
  • 8
  • 43
  • 69
2
votes
2 answers

How do you write a task to run tests in Rails 3?

I would like to write rake tasks to customize tests. For example, to run unit tests, I created a file with the following code and saved it as lib/tasks/test.rake: task :do_unit_tests do cd #{Rails.root} rake test:units end Running rake…
B Seven
  • 44,484
  • 66
  • 240
  • 385
2
votes
1 answer

Rails test: RuntimeError: can't modify frozen String

I'm trying to add my first test to my Rails project and I'm getting an error that I can't figure out. Everything works fine (I can create articles) normally from the browser, but I'm getting this error in my test: Test: test "should create…
Richard
  • 141
  • 7
2
votes
1 answer

Load rails fixtures before classes are loaded

I have classes in my Rails project that are 'registered' with attributes read from the database. However, when I run 'rake test', the classes are loaded before the fixtures are created in SQLLite. As a result, the classes are 'registered' with null…
Neel Vasa
  • 169
  • 1
  • 8
1
2 3 4