Questions tagged [test-first]
32 questions
1
vote
1 answer
String can't be coerced into Fixnum in TestFirst lesson
I'm working through the TestFirst.org tutorials and have gotten an error message I can't untangle:
Failure/Error: repeat("hello").should == "hello hello"
TypeError:
String can't be coerced into Fixnum
# ./03_simon_says/simon_says.rb:13:in `+'
…

alightholder
- 115
- 8
1
vote
1 answer
Testfirst.org - rpn_calculator - how can I pass a variable between methods?
I am trying to do this lesson and I am clearly missing something glaringly obvious!
require "rpn_calculator"
describe RPNCalculator do
attr_accessor :calculator
before do
@calculator = RPNCalculator.new
end
it "adds two numbers"…

user09274385
- 55
- 1
- 9
0
votes
0 answers
Grails refuses to run my integration test
I created a grails integration test using:
$ grails create-integration-test RoundControllerIntegration
and the following code was generated:
package gcbgb
import grails.test.mixin.integration.Integration
import grails.transaction.*
import…

spierepf
- 2,774
- 2
- 30
- 52
0
votes
4 answers
How to develop a StopWatch class test first?
I'm currently trying to implement a StopWatch class. The interface is something like:
interface IStopWatch {
void Run();
void Stop();
int SecondsElapsed { get; }
int MinutesElapsed { get; }
}
Basically my app will need to use a…

devoured elysium
- 101,373
- 131
- 340
- 557
0
votes
1 answer
TestFirst.org Dictionary Lesson Keyword Example Ruby
I am working through TestFirst.org's Ruby tutorial. I am currently on the "Dictionary" lesson. I am stuck on the keyword example. Here is the Ruby document as well as the RSpec file.
The reason I am confused is that I am not sure if the example is…

Steven L.
- 2,045
- 3
- 18
- 23
0
votes
1 answer
Terminal error using Test First Ruby
I'm just starting Test First Ruby & I'm having trouble running rakes to start solving problems.
I think it's either my version of RSpec or my version of Ruby that's causing the error.
Here's the error,
AT MacBook-Pro:01_temperature AT$ rake
(in…

nextstep
- 1,399
- 3
- 11
- 26
0
votes
0 answers
Test First Ruby Performance Monitor Rspec Error
I'm starting the 06_performance_monitor exercise in TestFirst Ruby and the failure it lists is in the Rspec that was provided in the materials for TestFirst Ruby tutorial (where it says undefined method 'measure'). From what I've been able to find…

heycait
- 1
- 1
0
votes
0 answers
Test-First-Ruby bug in calculator exercise?
I'm going through the Test-First-Ruby exercises, but I've hit an error that seems like a bug:
Failures:
1) add adds 0 and 0
Failure/Error: add(0,0).should == 0
NoMethodError:
undefined method add' for…
0
votes
2 answers
TestFirst Learn Ruby Simon Says
I'm doing TestFirst.org's Learn Ruby tutorial and am currently on exercise number 3 Simon Says. I'm not sure if this is a problem or if it's interfering with my tests (and giving me the wrong results) using rspec, but the terminal prints out some…

heycait
- 1
- 1
0
votes
1 answer
Rake, TestFirst, Error, Rspec Config Failed, Learn_Ruby
I have done an extensive search within the Q&As and have yet to find a solution, I hope you can guys can help.
I am currently attempting the TestFirst (Learn_Ruby TestFirst) and can't even get pass the the first test for 00_hello. When I type in…
0
votes
1 answer
TestFirst.org Learn_ruby rake and depreciation warnings :should and :expect syntax
After many searches via Google I'm ready to get some input from the community. I'm trying to apply for App Academy in San Francisco and one of the required pre-work is TestFirst's Learn_ruby. I original had this configured on a Linux VM on my…

Blake McNeal
- 31
- 3
0
votes
1 answer
having issues with finding the average run time of a block
I am currently doing Test First programming and am stuck on the 06_performance monitor problem located at http://testfirst.org/live/learn_ruby/performance_monitor I found a similar thread on stackoverflow but I still am not understanding the…

Sai Dandamudi
- 83
- 7
0
votes
1 answer
How come I can't set a key value pair as a variable, but I can set it as a parameter?
Working on dictionary lesson from Test First Teaching
In my dictionary.rb file I've got
def add(hash)
@new = Hash[hash]
@entries.merge!(@new)
end
My spec file uses add like this:
@d.add('fish' => 'aquatic animal')
Which works.
However,…

Kwestion
- 464
- 5
- 19
0
votes
2 answers
Test Authorize Controller
i saw practice in TDD Book for Test Authorize Controller but i don't understand exactly what that means this is code
Assert.IsTrue(typeof (TodoController)
.GetCustomAttributes(true).ToList()
…

Shahrooz Jafari
- 925
- 3
- 9
- 16
-1
votes
1 answer
Editing Class methods def self.xxx
If I am editing the Array class, shouldn't I have to define each method with a self (e.g. self.sum). I'm not sure why this passes the rpsec tests for the 'Test-First' Ruby track without the self.method immediately following the def.
class Array
…

mdp299
- 39
- 1
- 1
- 5