Open your favorite Text Editor and write this code in file.
I saved file with name greeter_spec.rb
class RSpecGreeter def greet "Hello RSpec!" end end describe "RSpec Greeter" do it "should say 'Hello RSpec!' when it receives the greet() message" do greeter = RSpecGreeter.new greeting = greeter.greet greeting.should == "Hello RSpec!" end end
Run this command:
rspec greeter_spec.rb where greeter_spec is file_name
describe declares and example group it used to declare example
Install Rspec and Cucumber using following link: