Sha256: c985f284e8634ec94b0c0dba3aa52de27ed7fe40bcf82d9bd11651576bbcd0ef

Contents?: true

Size: 811 Bytes

Versions: 9

Compression:

Stored size: 811 Bytes

Contents

require 'spec_helper'

describe :question do
  context "without input" do
    it "should raise an error" do
      proc { subject.should output("Are you a GOD?") }.should raise_error
    end
  end
  
  with_input "yes" do
    it "should act upon something" do
      subject.should act_upon("something")
      subject.should output(/Acted upon something/)
    end
    
    it "should not raise an error" do
      proc { subject.should output("Good.") }.should_not raise_error
    end
  end

  with_input "no" do
    it "should act upon something" do
      subject.should act_upon("something")
      subject.should output(/Acted upon something/)
    end
    
    it "should not raise an error" do
      proc { subject.should output("You're new around here, aren't you?") }.should_not raise_error
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
genspec-0.2.8 spec/generators/question_spec.rb
genspec-0.2.7 spec/generators/question_spec.rb
genspec-0.2.6 spec/generators/question_spec.rb
genspec-0.2.5 spec/generators/question_spec.rb
genspec-0.2.4 spec/generators/question_spec.rb
genspec-0.2.3 spec/generators/question_spec.rb
genspec-0.2.2 spec/generators/question_spec.rb
genspec-0.2.1 spec/generators/question_spec.rb
genspec-0.2.0 spec/generators/question_spec.rb