Sha256: 47cda5afc77668ca273fe182d8fd77aa9ce5a3c7343c8a809179533a6a6d1d0e

Contents?: true

Size: 1.97 KB

Versions: 61

Compression:

Stored size: 1.97 KB

Contents

FactoryBot.define do

  factory :language do
    sequence(:name) { |n| "lang#{n}" }

    runner_url { Faker::Internet.url }
    queriable { true }
  end

  factory :haskell, parent: :language do
    name { 'haskell' }
  end

  factory :bash, parent: :language do
    name { 'bash' }
    triable { true }
    stateful_console { true }
  end

  factory :text_language, parent: :language do
    name { 'text' }
  end

  factory :gobstones, parent: :language do
    name { 'gobstones' }
    extension { 'gbs' }
    queriable { false }
  end

  factory :exercise_base do
    language { guide ? guide.language : create(:language) }
    sequence(:bibliotheca_id) { |n| n }
    sequence(:number) { |n| n }

    locale { :en }
    guide
  end

  factory :challenge, parent: :exercise_base do
    layout { 'input_right' }
  end

  factory :reading, class: Reading, parent: :exercise_base do
    name { 'A reading' }
    description { 'Simple reading' }
  end

  factory :problem, class: Problem, parent: :challenge do
    name { 'A problem' }
    description { 'Simple problem' }
    test { 'dont care' }
  end

  factory :multiple_choice, parent: :problem do
    name { 'A multiple choice problem' }
    editor { :multiple_choice }
    description { 'Simple multiple choice problem' }
    choices { [{value: 'a', checked: true}, {value: 'b', checked: false }] }
  end

  factory :interactive, class: Interactive, parent: :challenge do
    name { 'An interactive problem' }
    description { 'Simple interactive problem' }
    goal { :query_passes }
    language { create(:bash) }
  end

  factory :playground, class: Playground, parent: :challenge do
    name { 'A Playground' }
    description { 'Simple playground' }
  end

  factory :exercise, parent: :problem

  factory :indexed_exercise, parent: :exercise do
    guide { create(:indexed_guide) }
  end

  factory :x_equal_5_exercise, parent: :exercise do
    test { 'describe "x" $ do
             it "should be equal 5" $ do
                x `shouldBe` 5' }
  end
end

Version data entries

61 entries across 61 versions & 2 rubygems

Version Path
mumuki-domain-9.8.1 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.8.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.7.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.6.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.5.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.4.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.3.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.2.1 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.2.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.1.2 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.1.1 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.1.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.0.6 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.0.5 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.0.4 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.0.3 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.0.2 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-9.0.0 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-8.6.1 lib/mumuki/domain/factories/exercise_factory.rb
mumuki-domain-8.6.0 lib/mumuki/domain/factories/exercise_factory.rb