Sha256: 4bf4c9873d3893c08acfaede9107d2f0273a2f0af63069c3a0d9710f112f9bea

Contents?: true

Size: 1.19 KB

Versions: 12

Compression:

Stored size: 1.19 KB

Contents

require 'xing'
require 'xing/cli/generators/new_project/user_input'

describe Xing::CLI::Generators::NewProject::UserInput do
  let :highline_mock do
    double("HighLine")
  end

  let :user_input do
    Xing::CLI::Generators::NewProject::UserInput.new
  end

  before do
    expect(HighLine).to receive(:new).and_return(highline_mock)
  end

  describe "no code of conduct" do
    before do
      expect(highline_mock).to receive(:ask).with("Add a Code of Conduct? (Contributor Covenant) [Y/n] ").and_return('n')
      user_input.gather
    end

    it "should have no code of conduct" do
      expect(user_input.code_of_conduct).to eq(false)
    end
  end

  describe "with code of conduct" do
    before do
      expect(highline_mock).to receive(:ask).with("Add a Code of Conduct? (Contributor Covenant) [Y/n] ").and_return('y')
      expect(highline_mock).to receive(:ask).with("Enter a contact email for your Code of Conduct:").and_return("cheese@landofcheese.com")
      user_input.gather
    end

    it "should have a code of conduct and a contact email" do
      expect(user_input.code_of_conduct).to eq(true)
      expect(user_input.coc_contact_email).to eq("cheese@landofcheese.com")
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
xing-framework-1.0.0.pre.beta.1 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-1.0.0.pre.beta spec/cli/generators/new_project/user_input_spec.rb
xing-framework-1.0.0.pre.alpha spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.3.2 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.3.1 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.3.0 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.2.9 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.2.9.beta1 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.2.8 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.2.8.beta1 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.2.7 spec/cli/generators/new_project/user_input_spec.rb
xing-framework-0.2.7.pre.beta1 spec/cli/generators/new_project/user_input_spec.rb