question-simpleChoice 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/#question-simpleChoice.gemspec# +27 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +15 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/.yardoc/checksums +13 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +7 -0
- data/Guardfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +32 -0
- data/Rakefile +15 -0
- data/doc/Examen.html +766 -0
- data/doc/Interfaz.html +440 -0
- data/doc/Lista.html +929 -0
- data/doc/Lista/Node.html +397 -0
- data/doc/Node.html +516 -0
- data/doc/Question.html +117 -0
- data/doc/Question/SimpleChoice.html +132 -0
- data/doc/Question/TrueOrFalse.html +134 -0
- data/doc/QuestionFather.html +565 -0
- data/doc/SimpleChoice.html +505 -0
- data/doc/TrueOrFalse.html +279 -0
- data/doc/_index.html +207 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +110 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +110 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +309 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/exam/examen.rb +85 -0
- data/lib/interfaz/interfaz.rb +49 -0
- data/lib/interfaz/interfazV2.rb +38 -0
- data/lib/node/node.rb +9 -0
- data/lib/nodelist/list.rb +119 -0
- data/lib/question/questionFather.rb +2 -0
- data/lib/question/questionFather/base.rb +16 -0
- data/lib/question/questionFather/version.rb +5 -0
- data/lib/question/simpleChoice.rb +2 -0
- data/lib/question/simpleChoice/base.rb +17 -0
- data/lib/question/simpleChoice/version.rb +5 -0
- data/lib/question/trueOrFalse.rb +2 -0
- data/lib/question/trueOrFalse/base.rb +10 -0
- data/lib/question/trueOrFalse/version.rb +5 -0
- data/lib/quiz/quiz.rb +58 -0
- data/prueba.html +1 -0
- data/prueba.rb +48 -0
- data/question-simpleChoice.gemspec +27 -0
- data/spec/list_spec.rb +51 -0
- data/spec/quiz_spec.rb +31 -0
- data/spec/simpleChoice_spec.rb +106 -0
- data/spec/spec_examen.rb +21 -0
- data/spec/spec_helper.rb +93 -0
- data/test.html +310 -0
- metadata +183 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require "./lib/question/questionFather/base"
|
3
|
+
class SimpleChoice < QuestionFather
|
4
|
+
attr_accessor :text, :distractor, :right
|
5
|
+
def initialize(args)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_s
|
10
|
+
options = @distractor + [@right]
|
11
|
+
options = options.shuffle
|
12
|
+
puts "- Elige la pregunta correcta de la siguiente pregunta #{@text} ?"
|
13
|
+
options.each {|o|}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
data/lib/quiz/quiz.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
if __FILE__ == $0 then
|
2
|
+
$: << "."
|
3
|
+
end
|
4
|
+
require './lib/nodelist/list'
|
5
|
+
require './lib/exam/examen'
|
6
|
+
require './lib/question/simpleChoice/base'
|
7
|
+
require './lib/question/trueOrFalse/base'
|
8
|
+
require './lib/question/questionFather/base'
|
9
|
+
|
10
|
+
class Quiz
|
11
|
+
attr_accessor :list, :title
|
12
|
+
def initialize (title, &block)
|
13
|
+
|
14
|
+
@list = Lista.new()
|
15
|
+
@i = 0
|
16
|
+
@title = title
|
17
|
+
@distractor = []
|
18
|
+
instance_eval &block
|
19
|
+
end
|
20
|
+
|
21
|
+
def question(text,answers={})
|
22
|
+
@text = text
|
23
|
+
@right = answers[:right] if answers[:right]
|
24
|
+
answers.map do |key,value|
|
25
|
+
@distractor << value if key != :right
|
26
|
+
end
|
27
|
+
@list.add(SimpleChoice.new(:text => @text,:right => @right,:distractor => @distractor,:dif => '1'))
|
28
|
+
@distractor = []
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
def right
|
33
|
+
:right
|
34
|
+
end
|
35
|
+
|
36
|
+
def wrong
|
37
|
+
@i = @i + 1
|
38
|
+
("distractor"+@i.to_s).intern
|
39
|
+
end
|
40
|
+
def to_exam
|
41
|
+
Examen.new(@list)
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
if __FILE__ == $0 then
|
47
|
+
quiz = Quiz.new("Cuestionario de LPP 05/12/2014") {
|
48
|
+
question '¿Cuantos argumentos de tipo bloque puede recibir un m´etodo?',
|
49
|
+
right =>'1',
|
50
|
+
wrong =>'2',
|
51
|
+
wrong =>'muchos',
|
52
|
+
wrong =>'los que defina el usuario'
|
53
|
+
question "En Ruby los bloque son objetos que continen codigo",
|
54
|
+
wrong =>'Cierto',
|
55
|
+
right =>'Falso'
|
56
|
+
}
|
57
|
+
puts quiz.list
|
58
|
+
end
|
data/prueba.html
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<h3>2+2=</h3><br/><input type="radio" value="5" name="0 "/>5<br/><input type="radio" value="6" name="0 "/>6<br/><input type="radio" value="2" name="0 "/>2<br/><input type="radio" value="4" name="0 "/>4<br/>
|
data/prueba.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
class Quiz
|
2
|
+
attr_accessor :title, :text, :right, :distractor
|
3
|
+
def initialize (title, &block)
|
4
|
+
@i = 0
|
5
|
+
@title = title
|
6
|
+
@distractor = []
|
7
|
+
instance_eval &block
|
8
|
+
end
|
9
|
+
|
10
|
+
def question(text,answers={})
|
11
|
+
@text = text
|
12
|
+
@right = answers[:right] if answers[:right]
|
13
|
+
answers.map do |key,value|
|
14
|
+
@distractor << value if key != :right
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
def right
|
20
|
+
:right
|
21
|
+
end
|
22
|
+
|
23
|
+
def wrong
|
24
|
+
@i = @i + 1
|
25
|
+
("distractor"+@i.to_s).intern
|
26
|
+
end
|
27
|
+
def to_s
|
28
|
+
puts @title
|
29
|
+
puts @text
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
if $0 == __FILE__ then
|
36
|
+
|
37
|
+
quiz = Quiz.new("Cuestionario de LPP 05/12/2014") {
|
38
|
+
question '¿Cuantos argumentos de tipo bloque puede recibir un metodo?',
|
39
|
+
right =>'1',
|
40
|
+
wrong =>'2',
|
41
|
+
wrong =>'muchos',
|
42
|
+
wrong =>'los que defina el usuario'
|
43
|
+
|
44
|
+
|
45
|
+
}
|
46
|
+
#puts quiz
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'question/simpleChoice/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "question-simpleChoice"
|
8
|
+
spec.version = Question::SimpleChoice::VERSION
|
9
|
+
spec.authors = ["Eduardo"]
|
10
|
+
spec.email = ["edudioniz@gmail.com"]
|
11
|
+
spec.description = %q{creador de examenes}
|
12
|
+
spec.summary = %q{creador de examenes}
|
13
|
+
spec.homepage = "http://www.creaexamen.com"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "guard"
|
24
|
+
spec.add_development_dependency "guard-rspec"
|
25
|
+
spec.add_development_dependency "guard-bundler"
|
26
|
+
|
27
|
+
end
|
data/spec/list_spec.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require './lib/nodelist/list'
|
3
|
+
require './lib/question/simpleChoice/base'
|
4
|
+
|
5
|
+
describe Lista do
|
6
|
+
before :each do
|
7
|
+
@listNum = Lista.new()
|
8
|
+
@listNum.add(1,2,3)
|
9
|
+
|
10
|
+
@listQuestion = Lista.new()
|
11
|
+
|
12
|
+
#Preguntas para el test de la practica 06
|
13
|
+
@p1 = SimpleChoice.new(:text =>"¿Cual es la salida del siguiente código Ruby ? \n class Xyz \n def pots \n @nice\n end\n end\n", :right => 'nil' ,:distractor => ['#<Xyz: 0xa000208>','0','Nunguna de las anteriores'], :dif => 2 )
|
14
|
+
@p2 = SimpleChoice.new(:text => "La siguiente definici´on de un hash en Ruby es v´alida:hash_raro = {[1, 2, 3] => Object.new(),Hash.new => :toto}", :right => 'falso', :distractor => 'Cierto', :dif =>1)
|
15
|
+
@p3 = SimpleChoice.new(:text =>"¿Cu´al es la salida del siguiente c´odigo Ruby?class Arraydef say_hi\"HEY!\"endendp [1, \"bob\"].say_hi", :right =>'"HEY!"', :distractor => ['1','bob','Nunguna de las anteriores'], :dif => 2 )
|
16
|
+
@p4 = SimpleChoice.new(:text => "¿Cu´al es el tipo del objeto en el siguiente c´odigo Ruby?class Objetoend", :right =>'Un objeto', :distractor => ['Una instancia de una clase', 'Una constante', 'Ninguna de las anteriores'], :dif => 5 )
|
17
|
+
@p5 = SimpleChoice.new(:text => "Es apropiado que una clase Tablero herede de una clase Juego.", :right => 'Cierto', :distractor => 'Falso', :dif => 3)
|
18
|
+
|
19
|
+
@listQuestion.add(@p1,@p2,@p3,@p4,@p5)
|
20
|
+
|
21
|
+
end
|
22
|
+
describe "Imprimiendo lista" do
|
23
|
+
it "Se imprime correctamente" do
|
24
|
+
expect(@listNum.to_a) == [1,2,3]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
=begin
|
28
|
+
describe "Lista de preguntas" do
|
29
|
+
it "La primera pregunta se almacena correctamente" do
|
30
|
+
expect(@listQuestion.first.right) == 'nil'
|
31
|
+
end
|
32
|
+
it "La primera pregunta se almacena correctamente" do
|
33
|
+
expect(@listQuestion.lastnext) == '#<struct Lista::Node value=#<Question::SimpleChoice:0x007f883506df28 @text="Es apropiado que una clase Tablero herede de una clase Juego.", @right="Cierto", @distractor="Falso">, next=nil>'
|
34
|
+
end
|
35
|
+
|
36
|
+
it "Listado de preguntas completo" do
|
37
|
+
expect(@listQuestion.to_s) == '#<struct Lista::Node value=#<Question::SimpleChoice:0x007fb7ac8f2918 @text="¿Cual es la salida del siguiente código Ruby ? \n class Xyz \n def pots \n @nice\n end\n end\n", @right="nil", @distractor=["#<Xyz: 0xa000208>", "0", "Nunguna de las anteriores"]>, next=#<struct Lista::Node value=#<Question::SimpleChoice:0x007fb7ac8f2850 @text="La siguiente definici´on de un hash en Ruby es v´alida:hash_raro = {[1, 2, 3] => Object.new(),Hash.new => :toto}", @right="falso", @distractor="Cierto">, next=#<struct Lista::Node value=#<Question::SimpleChoice:0x007fb7ac8f2710 @text="¿Cu´al es la salida del siguiente c´odigo Ruby?class Arraydef say_hi\"HEY!\"endendp [1, \"bob\"].say_hi", @right="\"HEY!\"", @distractor=["1", "bob", "Nunguna de las anteriores"]>, next=#<struct Lista::Node value=#<Question::SimpleChoice:0x007fb7ac8f25d0 @text="¿Cu´al es el tipo del objeto en el siguiente c´odigo Ruby?class Objetoend", @right="Un objeto", @distractor=["Una instancia de una clase", "Una constante", "Ninguna de las anteriores"]>, next=#<struct Lista::Node value=#<Question::SimpleChoice:0x007fb7ac8f2508 @text="Es apropiado que una clase Tablero herede de una clase Juego.", @right="Cierto", @distractor="Falso">, next=nil>>>>>'
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
=end
|
42
|
+
describe "Lista enumerable" do
|
43
|
+
it "Enumerable en la jerarquia de herencia" do
|
44
|
+
expect(@listQuestion.is_a? Enumerable) == 'true'
|
45
|
+
end
|
46
|
+
|
47
|
+
it "Se puede recorrer con each" do
|
48
|
+
expect(@listQuestion.each { |o| o }) == '#<Question::SimpleChoice:0x007fd9f3129a10 @text="¿Cual es la salida del siguiente código Ruby ? \n class Xyz \n def pots \n @nice\n end\n end\n", @right="nil", @distractor=["#<Xyz: 0xa000208>", "0", "Nunguna de las anteriores"]>#<Question::SimpleChoice:0x007fd9f3129948 @text="La siguiente definici´on de un hash en Ruby es v´alida:hash_raro = {[1, 2, 3] => Object.new(),Hash.new => :toto}", @right="falso", @distractor="Cierto">#<Question::SimpleChoice:0x007fd9f3129808 @text="¿Cu´al es la salida del siguiente c´odigo Ruby?class Arraydef say_hi\"HEY!\"endendp [1, \"bob\"].say_hi", @right="\"HEY!\"", @distractor=["1", "bob", "Nunguna de las anteriores"]>#<Question::SimpleChoice:0x007fd9f31296c8 @text="¿Cu´al es el tipo del objeto en el siguiente c´odigo Ruby?class Objetoend", @right="Un objeto", @distractor=["Una instancia de una clase", "Una constante", "Ninguna de las anteriores"]>#<Question::SimpleChoice:0x007fd9f3129600 @text="Es apropiado que una clase Tablero herede de una clase Juego.", @right="Cierto", @distractor="Falso">'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/spec/quiz_spec.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require './lib/exam/examen'
|
2
|
+
require './lib/quiz/quiz.rb'
|
3
|
+
describe Quiz do
|
4
|
+
before :each do
|
5
|
+
@z = Quiz.new("Cuestionario de LPP 05/12/2014") {
|
6
|
+
question '¿Cuantos argumentos de tipo bloque puede recibir un m´etodo?',
|
7
|
+
right =>'1',
|
8
|
+
wrong =>'2',
|
9
|
+
wrong =>'muchos',
|
10
|
+
wrong =>'los que defina el usuario'
|
11
|
+
question "En Ruby los bloque son objetos que continen codigo",
|
12
|
+
wrong =>'Cierto',
|
13
|
+
right =>'Falso'
|
14
|
+
}
|
15
|
+
end
|
16
|
+
describe "constructor" do
|
17
|
+
it "constructor correcto" do
|
18
|
+
expect(@z.title) == "Cuestionario de LPP 05/12/2014"
|
19
|
+
end
|
20
|
+
it "resultado" do
|
21
|
+
expect(@z.to_exam) == "<Examen:0x8ee8f10>"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
describe "lista" do
|
25
|
+
it "mostrar" do
|
26
|
+
|
27
|
+
expect(puts @z.list) ==" #<struct Node value=#<SimpleChoice:0x92b90f4 @text=\"¿Cuantos argumentos de tipo bloque puede recibir un m´etodo?\", @right=\"1\", @distractor=[\"2\", \"muchos\", \"los que defina el usuario\"], @dif=\"1\">, next=#<struct Node value=#<SimpleChoice:0x92b8f8c @text=\"En Ruby los bloque son objetos que continen codigo\", @right=\"Falso\", @distractor=[\"Cierto\"], @dif=\"1\">, next=nil, father=#<struct Node:...>>, father=nil>"
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require './lib/question/simpleChoice'
|
3
|
+
require './lib/question/trueOrFalse'
|
4
|
+
|
5
|
+
class TrueOrFalse
|
6
|
+
describe TrueOrFalse do
|
7
|
+
before :each do
|
8
|
+
@ptf = TrueOrFalse.new({:text=>'2+2=4',:right=>'true'})
|
9
|
+
end
|
10
|
+
context "Question True/false" do
|
11
|
+
it "tiene los valores esperados"do
|
12
|
+
expect(@ptf.text) == '2 + 2 ='
|
13
|
+
expect(@ptf.right) == 'true'
|
14
|
+
end
|
15
|
+
it "To String"do
|
16
|
+
expect(@ptf.to_s) == 'Responde "true" or "false" la siguiente pregunta 2+2=4
|
17
|
+
-True
|
18
|
+
-False
|
19
|
+
'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
class SimpleChoice
|
25
|
+
describe SimpleChoice do
|
26
|
+
before :each do
|
27
|
+
@sc = SimpleChoice.new(:text => '2 + 2 =',
|
28
|
+
:right => 4,
|
29
|
+
:distractor => [9,3,1])
|
30
|
+
#Preguntas para el test de la practica 06
|
31
|
+
@p1 = SimpleChoice.new(:text =>"¿Cual es la salida del siguiente codigo Ruby ? \n class Xyz \n def pots \n @nice\n end\n end\n", :right => 'nil' ,:distractor => ['#<Xyz: 0xa000208>','0','Nunguna de las anteriores'], :dif => 1 )
|
32
|
+
@p2 = SimpleChoice.new(:text => "La siguiente definici´on de un hash en Ruby es v´alida:
|
33
|
+
|
34
|
+
hash_raro = {
|
35
|
+
|
36
|
+
[1, 2, 3] => Object.new(),
|
37
|
+
|
38
|
+
Hash.new => :toto
|
39
|
+
|
40
|
+
}", :right => 'falso', :distractor => 'Cierto', :dif => 2)
|
41
|
+
|
42
|
+
@p3 = SimpleChoice.new(:text =>" ¿Cu´al es la salida del siguiente c´odigo Ruby?
|
43
|
+
|
44
|
+
class Array
|
45
|
+
|
46
|
+
def say_hi
|
47
|
+
|
48
|
+
\"HEY!\"
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
p [1, \"bob\"].say_hi", :right =>'"HEY!"', :distractor => ['1','bob','Nunguna de las anteriores'], :dif =>3 )
|
55
|
+
@p4 = SimpleChoice.new(:text => "¿Cu´al es el tipo del objeto en el siguiente c´odigo Ruby?
|
56
|
+
|
57
|
+
class Objeto
|
58
|
+
|
59
|
+
end
|
60
|
+
", :right =>'Un objeto', :distractor => ['Una instancia de una clase', 'Una constante', 'Ninguna de las anteriores'] ,:dif=>4)
|
61
|
+
@p5 = SimpleChoice.new(:text => " Es apropiado que una clase Tablero herede de una clase Juego.
|
62
|
+
", :right => 'Cierto', :distractor => 'Falso',:dif=>5)
|
63
|
+
|
64
|
+
|
65
|
+
end
|
66
|
+
context "Creando una pregunta" do
|
67
|
+
it "Se crea correctamente" do
|
68
|
+
expect(@sc.text) == '2 + 2 ='
|
69
|
+
expect(@sc.right) == 4
|
70
|
+
expect(@sc.distractor) == [9,3,1]
|
71
|
+
end
|
72
|
+
it "to String" do
|
73
|
+
expect(@sc.to_s) == '- Elige la pregunta correcta de la siguiente pregunta 2 + 2 = ?
|
74
|
+
9
|
75
|
+
4
|
76
|
+
3
|
77
|
+
1
|
78
|
+
'
|
79
|
+
end
|
80
|
+
it "Pregunta 1" do
|
81
|
+
expect(@p1.right) == 'nil'
|
82
|
+
end
|
83
|
+
it "Pregunta 2" do
|
84
|
+
expect(@p2.right) == 'falso'
|
85
|
+
end
|
86
|
+
it "Pregunta 3"do
|
87
|
+
expect(@p3.right) == '"HEY!"'
|
88
|
+
end
|
89
|
+
it "Pregunta 4"do
|
90
|
+
expect(@p4.right) == 'Un objeto'
|
91
|
+
end
|
92
|
+
it "Pregunta 5"do
|
93
|
+
expect(@p5.right) == 'Cierto'
|
94
|
+
end
|
95
|
+
end
|
96
|
+
context "Comparable" do
|
97
|
+
it "Es comparable" do
|
98
|
+
expect(@p5.is_a? Comparable) == true
|
99
|
+
end
|
100
|
+
it "Comparacion" do
|
101
|
+
expect(@p5<=>@p5) == 0
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
data/spec/spec_examen.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require './lib/exam/examen'
|
2
|
+
require './lib/question/simpleChoice/base'
|
3
|
+
require './lib/nodelist/list'
|
4
|
+
describe Examen do
|
5
|
+
before :each do
|
6
|
+
@p1 = SimpleChoice.new(:text => '1)2 + 2 = ',:right => '1',:distractor => [5,3,2], :dif =>1)
|
7
|
+
@p2 = SimpleChoice.new(:text => '2)5 + 2 = ',:right => '2',:distractor => [5,3,2], :dif =>1)
|
8
|
+
@p3 = SimpleChoice.new(:text => '3)2 * 2 = ',:right => '3',:distractor => [5,3,2], :dif =>1)
|
9
|
+
|
10
|
+
@list = Lista.new()
|
11
|
+
@list.add(@p1,@p2,@p3)
|
12
|
+
@examen = Examen.new(@list)
|
13
|
+
|
14
|
+
|
15
|
+
end
|
16
|
+
describe "constructor" do
|
17
|
+
it "lista asignada correctamente" do
|
18
|
+
expect(@examen.list) == @list
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
#require 'coveralls'
|
2
|
+
#Coveralls.wear!
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
6
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
7
|
+
#
|
8
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
9
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
10
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
11
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
12
|
+
# a separate helper file that requires the additional dependencies and performs
|
13
|
+
# the additional setup, and require it from the spec files that actually need it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
=begin ---------------------------------------------------------------------------
|
20
|
+
RSpec.configure do |config|
|
21
|
+
# rspec-expectations config goes here. You can use an alternate
|
22
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
23
|
+
# assertions if you prefer.
|
24
|
+
config.expect_with :rspec do |expectations|
|
25
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
26
|
+
# and `failure_message` of custom matchers include text for helper methods
|
27
|
+
# defined using `chain`, e.g.:
|
28
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
29
|
+
# # => "be bigger than 2 and smaller than 4"
|
30
|
+
# ...rather than:
|
31
|
+
# # => "be bigger than 2"
|
32
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
33
|
+
end
|
34
|
+
|
35
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
36
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
37
|
+
config.mock_with :rspec do |mocks|
|
38
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
39
|
+
# a real object. This is generally recommended, and will default to
|
40
|
+
# `true` in RSpec 4.
|
41
|
+
mocks.verify_partial_doubles = true
|
42
|
+
end
|
43
|
+
|
44
|
+
# The settings below are suggested to provide a good initial experience
|
45
|
+
# with RSpec, but feel free to customize to your heart's content.
|
46
|
+
=begin
|
47
|
+
# These two settings work together to allow you to limit a spec run
|
48
|
+
# to individual examples or groups you care about by tagging them with
|
49
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
50
|
+
# get run.
|
51
|
+
config.filter_run :focus
|
52
|
+
config.run_all_when_everything_filtered = true
|
53
|
+
|
54
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
55
|
+
# For more details, see:
|
56
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
57
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
58
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
59
|
+
config.disable_monkey_patching!
|
60
|
+
|
61
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
62
|
+
# be too noisy due to issues in dependencies.
|
63
|
+
config.warnings = true
|
64
|
+
|
65
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
66
|
+
# file, and it's useful to allow more verbose output when running an
|
67
|
+
# individual spec file.
|
68
|
+
if config.files_to_run.one?
|
69
|
+
# Use the documentation formatter for detailed output,
|
70
|
+
# unless a formatter has already been configured
|
71
|
+
# (e.g. via a command-line flag).
|
72
|
+
config.default_formatter = 'doc'
|
73
|
+
end
|
74
|
+
|
75
|
+
# Print the 10 slowest examples and example groups at the
|
76
|
+
# end of the spec run, to help surface which specs are running
|
77
|
+
# particularly slow.
|
78
|
+
config.profile_examples = 10
|
79
|
+
|
80
|
+
# Run specs in random order to surface order dependencies. If you find an
|
81
|
+
# order dependency and want to debug it, you can fix the order by providing
|
82
|
+
# the seed, which is printed after each run.
|
83
|
+
# --seed 1234
|
84
|
+
config.order = :random
|
85
|
+
|
86
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
87
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
88
|
+
# test failures related to randomization by passing the same `--seed` value
|
89
|
+
# as the one that triggered the failure.
|
90
|
+
Kernel.srand config.seed
|
91
|
+
--------
|
92
|
+
end
|
93
|
+
=end
|